diff options
Diffstat (limited to 'net/dcsctp/tx/rr_send_queue.h')
-rw-r--r-- | net/dcsctp/tx/rr_send_queue.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/net/dcsctp/tx/rr_send_queue.h b/net/dcsctp/tx/rr_send_queue.h index c4111ff717..b6c359dc1e 100644 --- a/net/dcsctp/tx/rr_send_queue.h +++ b/net/dcsctp/tx/rr_send_queue.h @@ -22,6 +22,7 @@ #include "absl/strings/string_view.h" #include "absl/types/optional.h" #include "api/array_view.h" +#include "net/dcsctp/common/internal_types.h" #include "net/dcsctp/public/dcsctp_message.h" #include "net/dcsctp/public/dcsctp_socket.h" #include "net/dcsctp/public/types.h" @@ -70,15 +71,14 @@ class RRSendQueue : public SendQueue { // time should be in `now`. Note that it's the responsibility of the caller to // ensure that the buffer is not full (by calling `IsFull`) before adding // messages to it. - void Add(TimeMs now, + void Add(webrtc::Timestamp now, DcSctpMessage message, const SendOptions& send_options = {}); // Implementation of `SendQueue`. - absl::optional<DataToSend> Produce(TimeMs now, size_t max_size) override; - bool Discard(IsUnordered unordered, - StreamID stream_id, - MID message_id) override; + absl::optional<DataToSend> Produce(webrtc::Timestamp now, + size_t max_size) override; + bool Discard(StreamID stream_id, OutgoingMessageId message_id) override; void PrepareResetStream(StreamID streams) override; bool HasStreamsReadyToBeReset() const override; std::vector<StreamID> GetStreamsReadyToBeReset() override; @@ -105,7 +105,7 @@ class RRSendQueue : public SendQueue { struct MessageAttributes { IsUnordered unordered; MaxRetransmits max_retransmissions; - TimeMs expires_at; + webrtc::Timestamp expires_at; LifecycleId lifecycle_id; }; @@ -155,7 +155,7 @@ class RRSendQueue : public SendQueue { void Add(DcSctpMessage message, MessageAttributes attributes); // Implementing `StreamScheduler::StreamProducer`. - absl::optional<SendQueue::DataToSend> Produce(TimeMs now, + absl::optional<SendQueue::DataToSend> Produce(webrtc::Timestamp now, size_t max_size) override; size_t bytes_to_send_in_next_message() const override; @@ -163,7 +163,7 @@ class RRSendQueue : public SendQueue { ThresholdWatcher& buffered_amount() { return buffered_amount_; } // Discards a partially sent message, see `SendQueue::Discard`. - bool Discard(IsUnordered unordered, MID message_id); + bool Discard(OutgoingMessageId message_id); // Pauses this stream, which is used before resetting it. void Pause(); @@ -219,11 +219,15 @@ class RRSendQueue : public SendQueue { // An enqueued message and metadata. struct Item { - explicit Item(DcSctpMessage msg, MessageAttributes attributes) - : message(std::move(msg)), + explicit Item(OutgoingMessageId message_id, + DcSctpMessage msg, + MessageAttributes attributes) + : message_id(message_id), + message(std::move(msg)), attributes(std::move(attributes)), remaining_offset(0), remaining_size(message.payload().size()) {} + OutgoingMessageId message_id; DcSctpMessage message; MessageAttributes attributes; // The remaining payload (offset and size) to be sent, when it has been @@ -232,7 +236,7 @@ class RRSendQueue : public SendQueue { size_t remaining_size; // If set, an allocated Message ID and SSN. Will be allocated when the // first fragment is sent. - absl::optional<MID> message_id = absl::nullopt; + absl::optional<MID> mid = absl::nullopt; absl::optional<SSN> ssn = absl::nullopt; // The current Fragment Sequence Number, incremented for each fragment. FSN current_fsn = FSN(0); @@ -262,13 +266,14 @@ class RRSendQueue : public SendQueue { OutgoingStream& GetOrCreateStreamInfo(StreamID stream_id); absl::optional<DataToSend> Produce( std::map<StreamID, OutgoingStream>::iterator it, - TimeMs now, + webrtc::Timestamp now, size_t max_size); const absl::string_view log_prefix_; DcSctpSocketCallbacks& callbacks_; const size_t buffer_size_; const StreamPriority default_priority_; + OutgoingMessageId current_message_id = OutgoingMessageId(0); StreamScheduler scheduler_; // The total amount of buffer data, for all streams. |