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

Unified Diff: net/quic/reliable_quic_stream.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_utils.cc ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/reliable_quic_stream.h
diff --git a/net/quic/reliable_quic_stream.h b/net/quic/reliable_quic_stream.h
index 829a288032a0189e59f0fa8b92b7bc6fddd661c2..2aa66e6afa07d11726a9a19cbcd266aec06e35e5 100644
--- a/net/quic/reliable_quic_stream.h
+++ b/net/quic/reliable_quic_stream.h
@@ -11,6 +11,10 @@
#include <list>
+#include "base/strings/string_piece.h"
+#include "net/base/iovec.h"
+#include "net/base/net_export.h"
+#include "net/quic/quic_spdy_decompressor.h"
#include "net/quic/quic_stream_sequencer.h"
namespace net {
@@ -23,7 +27,8 @@ class IPEndPoint;
class QuicSession;
// All this does right now is send data to subclasses via the sequencer.
-class NET_EXPORT_PRIVATE ReliableQuicStream {
+class NET_EXPORT_PRIVATE ReliableQuicStream : public
+ QuicSpdyDecompressor::Visitor {
public:
// Visitor receives callbacks from the stream.
class Visitor {
@@ -65,17 +70,29 @@ class NET_EXPORT_PRIVATE ReliableQuicStream {
// stream close from the peer.
virtual void TerminateFromPeer(bool half_close);
+ virtual uint32 ProcessRawData(const char* data, uint32 data_len);
+ virtual uint32 ProcessHeaderData();
+
virtual uint32 ProcessData(const char* data, uint32 data_len) = 0;
+ virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE;
+
// Called to close the stream from this end.
virtual void Close(QuicRstStreamErrorCode error);
// This block of functions wraps the sequencer's functions of the same
- // name.
+ // name. These methods return uncompressed data until that has
+ // been fully processed. Then they simply delegate to the sequencer.
+ virtual int Readv(const struct iovec* iov, int iov_len);
+ virtual int GetReadableRegions(iovec* iov, int iov_len);
virtual bool IsHalfClosed() const;
virtual bool IsClosed() const;
virtual bool HasBytesToRead() const;
+ // Called by the session when a decompression blocked stream
+ // becomes unblocked.
+ virtual void OnDecompressorAvailable();
+
QuicStreamId id() const { return id_; }
QuicRstStreamErrorCode stream_error() const { return stream_error_; }
@@ -84,14 +101,14 @@ class NET_EXPORT_PRIVATE ReliableQuicStream {
bool read_side_closed() const { return read_side_closed_; }
bool write_side_closed() const { return write_side_closed_; }
+ uint64 stream_bytes_read() { return stream_bytes_read_; }
+ uint64 stream_bytes_written() { return stream_bytes_written_; }
+
const IPEndPoint& GetPeerAddress() const;
Visitor* visitor() { return visitor_; }
void set_visitor(Visitor* visitor) { visitor_ = visitor; }
- uint64 stream_bytes_read() const { return stream_bytes_read_; }
- uint64 stream_bytes_written() const { return stream_bytes_written_; }
-
protected:
// Returns a pair with the number of bytes consumed from data, and a boolean
// indicating if the fin bit was consumed. This does not indicate the data
@@ -136,6 +153,16 @@ class NET_EXPORT_PRIVATE ReliableQuicStream {
// framing, encryption overhead etc.
uint64 stream_bytes_read_;
uint64 stream_bytes_written_;
+ // True if the headers have been completely decompresssed.
+ bool headers_complete_;
+ // ID of the header block sent by the peer, once parsed.
+ QuicHeaderId headers_id_;
+ // Buffer into which we write bytes from the headers_id_
+ // until it is fully parsed.
+ string headers_id_buffer_;
+ // Contains a copy of the decompressed headers_ until they are consumed
+ // via ProcessData or Readv.
+ string decompressed_headers_;
// Stream error code received from a RstStreamFrame or error code sent by the
// visitor or sequencer in the RstStreamFrame.
« no previous file with comments | « net/quic/quic_utils.cc ('k') | net/quic/reliable_quic_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698