Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: net/quic/quic_stream_sequencer.h

Issue 1414573004: Introduces QuicStreamSequencerBufferInterface with one implementation. Refactor, no behavior change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing the build file (previously missing a comma) Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_frame_list.cc ('k') | net/quic/quic_stream_sequencer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_sequencer.h
diff --git a/net/quic/quic_stream_sequencer.h b/net/quic/quic_stream_sequencer.h
index 722305f22397185f2759831ec44d2e67f22455cd..d7ec9429b0c529ee68b135da146f77b6a0816314 100644
--- a/net/quic/quic_stream_sequencer.h
+++ b/net/quic/quic_stream_sequencer.h
@@ -78,8 +78,11 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {
// automatically when the FIN is consumed (which may be immediately).
void StopReading();
- size_t num_bytes_buffered() const { return num_bytes_buffered_; }
- QuicStreamOffset num_bytes_consumed() const { return num_bytes_consumed_; }
+ // Number of bytes in the buffer right now.
+ size_t NumBytesBuffered() const;
+
+ // Number of bytes has been consumed.
+ QuicStreamOffset NumBytesConsumed() const;
int num_frames_received() const { return num_frames_received_; }
@@ -105,18 +108,11 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {
// the stream of FIN, and clear buffers.
bool MaybeCloseStream();
- // Called whenever bytes are consumed by the stream. Updates
- // num_bytes_consumed_ and num_bytes_buffered_.
- void RecordBytesConsumed(size_t bytes_consumed);
-
// The stream which owns this sequencer.
ReliableQuicStream* stream_;
- // The last data consumed by the stream.
- QuicStreamOffset num_bytes_consumed_;
-
- // Stores buffered frames in offset order.
- QuicFrameList buffered_frames_;
+ // Stores received data in offset order.
+ std::unique_ptr<QuicStreamSequencerBufferInterface> buffered_frames_;
Ryan Hamilton 2015/10/21 16:44:52 use scoped_ptr instead of std::unique_ptr or this
// The offset, if any, we got a stream termination for. When this many bytes
// have been processed, the sequencer will be closed.
@@ -126,9 +122,6 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {
// buffer all new incoming data until FlushBufferedFrames is called.
bool blocked_;
- // Tracks how many bytes the sequencer has buffered.
- size_t num_bytes_buffered_;
-
// Count of the number of frames received.
int num_frames_received_;
« no previous file with comments | « net/quic/quic_frame_list.cc ('k') | net/quic/quic_stream_sequencer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698