Created and integrated QuicIntervalDeque class for index management. Improves code readability.
gfe-relnote: Integrated QuicIntervalDeque class into QuicStreamSendBuffer affecting the QUIC GFE path. Protected by --gfe2_reloadable_flag_quic_interval_deque
PiperOrigin-RevId: 286471930
Change-Id: Ida91b6c7d066d9710d06932c9f4726946bfbd430
diff --git a/quic/core/quic_stream_send_buffer.h b/quic/core/quic_stream_send_buffer.h
index 51a10e9..57be51d 100644
--- a/quic/core/quic_stream_send_buffer.h
+++ b/quic/core/quic_stream_send_buffer.h
@@ -6,6 +6,7 @@
#define QUICHE_QUIC_CORE_QUIC_STREAM_SEND_BUFFER_H_
#include "net/third_party/quiche/src/quic/core/frames/quic_stream_frame.h"
+#include "net/third_party/quiche/src/quic/core/quic_interval_deque.h"
#include "net/third_party/quiche/src/quic/core/quic_interval_set.h"
#include "net/third_party/quiche/src/quic/core/quic_types.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_containers.h"
@@ -35,6 +36,9 @@
BufferedSlice& operator=(const BufferedSlice& other) = delete;
~BufferedSlice();
+ // Return an interval representing the offset and length.
+ QuicInterval<std::size_t> interval() const;
+
// Stream data of this data slice.
QuicMemSlice slice;
// Location of this data slice in the stream.
@@ -141,7 +145,12 @@
// Cleanup empty slices in order from buffered_slices_.
void CleanUpBufferedSlices();
+ bool interval_deque_active_;
QuicDeque<BufferedSlice> buffered_slices_;
+ // |current_end_offset_| stores the end offset of the current slice to ensure
+ // data isn't being written out of order when using the |interval_deque_|.
+ QuicStreamOffset current_end_offset_;
+ QuicIntervalDeque<BufferedSlice> interval_deque_;
// Offset of next inserted byte.
QuicStreamOffset stream_offset_;