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

Unified Diff: net/quic/quic_stream_sequencer.h

Issue 14651009: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix integer constant is too large for 'unsigned long' type Created 7 years, 7 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_spdy_decompressor_test.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 04a47f05b0116917afc7996cc0b558e1360f0fce..acd7ada74b11c5af4afd5804a59a11a507d408e6 100644
--- a/net/quic/quic_stream_sequencer.h
+++ b/net/quic/quic_stream_sequencer.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "net/base/iovec.h"
#include "net/quic/quic_protocol.h"
using std::map;
@@ -56,6 +57,18 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {
// Once data is buffered, it's up to the stream to read it when the stream
// can handle more data. The following three functions make that possible.
+ // Fills in up to iov_len iovecs with the next readable regions. Returns the
+ // number of iovs used. Non-destructive of the underlying data.
+ int GetReadableRegions(iovec* iov, int iov_len);
+
+ // Copies the data into the iov_len buffers provided. Returns the number of
+ // bytes read. Any buffered data no longer in use will be released.
+ int Readv(const struct iovec* iov, int iov_len);
+
+ // Consumes |num_bytes| data. Used in conjunction with |GetReadableRegions|
+ // to do zero-copy reads.
+ void MarkConsumed(size_t num_bytes);
+
// Returns true if the sequncer has bytes available for reading.
bool HasBytesToRead() const;
@@ -68,14 +81,16 @@ class NET_EXPORT_PRIVATE QuicStreamSequencer {
// Returns true if the sequencer has received this frame before.
bool IsDuplicate(const QuicStreamFrame& frame) const;
+ // Calls |ProcessRawData| on |stream_| for each buffered frame that may
+ // be processed.
+ void FlushBufferedFrames();
+
private:
friend class test::QuicStreamSequencerPeer;
// TODO(alyssar) use something better than strings.
typedef map<QuicStreamOffset, string> FrameMap;
- void FlushBufferedFrames();
-
bool MaybeCloseStream();
ReliableQuicStream* stream_; // The stream which owns this sequencer.
« no previous file with comments | « net/quic/quic_spdy_decompressor_test.cc ('k') | net/quic/quic_stream_sequencer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698