| Index: net/quic/reliable_quic_stream.h
|
| diff --git a/net/quic/reliable_quic_stream.h b/net/quic/reliable_quic_stream.h
|
| index ac6a7823267deb4331e1c5713bdd725b324f466f..210b8ad0c4eb274391c4dae52550c31decda7cc4 100644
|
| --- a/net/quic/reliable_quic_stream.h
|
| +++ b/net/quic/reliable_quic_stream.h
|
| @@ -15,8 +15,8 @@
|
| #include "net/base/iovec.h"
|
| #include "net/base/net_export.h"
|
| #include "net/quic/quic_ack_notifier.h"
|
| +#include "net/quic/quic_protocol.h"
|
| #include "net/quic/quic_spdy_compressor.h"
|
| -#include "net/quic/quic_spdy_decompressor.h"
|
| #include "net/quic/quic_stream_sequencer.h"
|
|
|
| namespace net {
|
| @@ -29,27 +29,8 @@ class IPEndPoint;
|
| class QuicSession;
|
| class SSLInfo;
|
|
|
| -#define ENDPOINT (is_server_ ? "Server: " : " Client: ")
|
| -
|
| -// All this does right now is send data to subclasses via the sequencer.
|
| -class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
| - QuicSpdyDecompressor::Visitor {
|
| +class NET_EXPORT_PRIVATE ReliableQuicStream {
|
| public:
|
| - // Visitor receives callbacks from the stream.
|
| - class Visitor {
|
| - public:
|
| - Visitor() {}
|
| -
|
| - // Called when the stream is closed.
|
| - virtual void OnClose(ReliableQuicStream* stream) = 0;
|
| -
|
| - protected:
|
| - virtual ~Visitor() {}
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(Visitor);
|
| - };
|
| -
|
| ReliableQuicStream(QuicStreamId id,
|
| QuicSession* session);
|
|
|
| @@ -80,12 +61,7 @@ class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
| // Called when the final data has been read.
|
| virtual void OnFinRead();
|
|
|
| - virtual uint32 ProcessRawData(const char* data, uint32 data_len);
|
| -
|
| - virtual uint32 ProcessData(const char* data, uint32 data_len) = 0;
|
| -
|
| - virtual bool OnDecompressedData(base::StringPiece data) OVERRIDE;
|
| - virtual void OnDecompressionError() OVERRIDE;
|
| + virtual uint32 ProcessRawData(const char* data, uint32 data_len) = 0;
|
|
|
| // Called to reset the stream from this end.
|
| virtual void Reset(QuicRstStreamErrorCode error);
|
| @@ -95,24 +71,9 @@ class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
| virtual void CloseConnectionWithDetails(QuicErrorCode error,
|
| const string& details);
|
|
|
| - // This block of functions wraps the sequencer's functions of the same
|
| - // name. These methods return uncompressed data until that has
|
| - // been fully processed. Then they simply delegate to the sequencer.
|
| - virtual size_t Readv(const struct iovec* iov, size_t iov_len);
|
| - virtual int GetReadableRegions(iovec* iov, size_t iov_len);
|
| - // Returns true when all data has been read from the peer, including the fin.
|
| - virtual bool IsDoneReading() const;
|
| - virtual bool HasBytesToRead() const;
|
| -
|
| - // Called by the session when a decompression blocked stream
|
| - // becomes unblocked.
|
| - virtual void OnDecompressorAvailable();
|
| -
|
| - // By default, this is the same as priority(), however it allows streams
|
| - // to temporarily alter effective priority. For example if a SPDY stream has
|
| - // compressed but not written headers it can write the headers with a higher
|
| - // priority.
|
| - virtual QuicPriority EffectivePriority() const;
|
| + // Returns the effective priority for the stream. This value may change
|
| + // during the life of the stream.
|
| + virtual QuicPriority EffectivePriority() const = 0;
|
|
|
| QuicStreamId id() const { return id_; }
|
|
|
| @@ -125,17 +86,6 @@ class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
| uint64 stream_bytes_read() { return stream_bytes_read_; }
|
| uint64 stream_bytes_written() { return stream_bytes_written_; }
|
|
|
| - const IPEndPoint& GetPeerAddress() const;
|
| -
|
| - void set_visitor(Visitor* visitor) { visitor_ = visitor; }
|
| -
|
| - QuicSpdyCompressor* compressor();
|
| -
|
| - // Gets the SSL connection information.
|
| - bool GetSSLInfo(SSLInfo* ssl_info);
|
| -
|
| - bool headers_decompressed() const { return headers_decompressed_; }
|
| -
|
| protected:
|
| // Sends as much of 'data' to the connection as the connection will consume,
|
| // and then buffers any remaining data in queued_data_.
|
| @@ -164,46 +114,22 @@ class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
|
|
| QuicSession* session() { return session_; }
|
|
|
| - // Sets priority_ to priority. This should only be called before bytes are
|
| - // written to the server.
|
| - void set_priority(QuicPriority priority);
|
| - // This is protected because external classes should use EffectivePriority
|
| - // instead.
|
| - QuicPriority priority() const { return priority_; }
|
| + const QuicStreamSequencer* sequencer() const { return &sequencer_; }
|
| + QuicStreamSequencer* sequencer() { return &sequencer_; }
|
|
|
| private:
|
| friend class test::ReliableQuicStreamPeer;
|
| friend class QuicStreamUtils;
|
|
|
| - uint32 ProcessHeaderData();
|
| -
|
| - uint32 StripPriorityAndHeaderId(const char* data, uint32 data_len);
|
| -
|
| std::list<string> queued_data_;
|
|
|
| QuicStreamSequencer sequencer_;
|
| QuicStreamId id_;
|
| QuicSession* session_;
|
| - // Optional visitor of this stream to be notified when the stream is closed.
|
| - Visitor* visitor_;
|
| // Bytes read and written refer to payload bytes only: they do not include
|
| // framing, encryption overhead etc.
|
| uint64 stream_bytes_read_;
|
| uint64 stream_bytes_written_;
|
| - // True if the headers have been completely decompresssed.
|
| - bool headers_decompressed_;
|
| - // The priority of the stream, once parsed.
|
| - QuicPriority priority_;
|
| - // ID of the header block sent by the peer, once parsed.
|
| - QuicHeaderId headers_id_;
|
| - // Buffer into which we write bytes from priority_ and headers_id_
|
| - // until each is fully parsed.
|
| - string headers_id_and_priority_buffer_;
|
| - // Contains a copy of the decompressed headers_ until they are consumed
|
| - // via ProcessData or Readv.
|
| - string decompressed_headers_;
|
| - // True if an error was encountered during decompression.
|
| - bool decompression_failed_;
|
|
|
| // Stream error code received from a RstStreamFrame or error code sent by the
|
| // visitor or sequencer in the RstStreamFrame.
|
| @@ -218,13 +144,13 @@ class NET_EXPORT_PRIVATE ReliableQuicStream : public
|
| // True if the write side is closed, and further writes should fail.
|
| bool write_side_closed_;
|
|
|
| - // True if the priority has been read, false otherwise.
|
| - bool priority_parsed_;
|
| bool fin_buffered_;
|
| bool fin_sent_;
|
|
|
| // True if the session this stream is running under is a server session.
|
| bool is_server_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ReliableQuicStream);
|
| };
|
|
|
| } // namespace net
|
|
|