summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_stream_sequencer.h
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 20:55:04 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-07 20:55:04 +0000
commitc244c5a193c87604027741ec38b456ff9a446f8e (patch)
tree61c50a1031d9315cdafde41c1884c70f69639471 /net/quic/quic_stream_sequencer.h
parent9c9b2ae80da65e2d2e0d98df1827723b307d382d (diff)
downloadchromium_src-c244c5a193c87604027741ec38b456ff9a446f8e.zip
chromium_src-c244c5a193c87604027741ec38b456ff9a446f8e.tar.gz
chromium_src-c244c5a193c87604027741ec38b456ff9a446f8e.tar.bz2
Land Recent QUIC changes
Implement header compression/decompression in ReliableQuicStream. Merge internal change: 44867738 QUIC: deflake proof_test. The current proof_test removes a byte from the start of the signature in order to make it invalid. However, the signature is a big-endian number and, ~1% of the time, the first byte will be zero - thus removing it doesn't change the number. This change adds a non-zero byte to the start of the signature instead. Merge internal change: 44803399 Replace calls to scoped_ptr(NULL) with calls to scoped_ptr(). Merge internal change: 44799980 Add a blank line in order to get the dependencies correct for rebuild. Merge internal change: 44796024 Fix "large integer implicitly truncated to unsigned type" Merge internal change: 44793986 QUIC: compress certificates. This change causes server certificates to be compressed using three tricks: 1) The client can advertise sets of common certificates that the server can then simply reference. This change contains "common certificate set 0", which is the set of the intermediates used twice or more in the Alexa top 5000. It's temporary because it's missing GIAG2 which we'll want to include soon. 2) The client can send 64-bit, FNV-1a hashes of certificates that it already has and the server can reference them by hash. 3) Otherwise, certifciates are gzip compressed with a dictionary that includes any certificates compressed using the previous two methods and a 1500 byte lump of common substrings. (Again, taken from the Alexa top 5000) POKE=1 Merge internal change: 44792710 R=mnaganov@chromium.org, rch@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=198736 Review URL: https://codereview.chromium.org/14651009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198793 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_stream_sequencer.h')
-rw-r--r--net/quic/quic_stream_sequencer.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/net/quic/quic_stream_sequencer.h b/net/quic/quic_stream_sequencer.h
index 04a47f0..acd7ada 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.