OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // The base class for streams which deliver data to/from an application. | 5 // The base class for streams which deliver data to/from an application. |
6 // In each direction, the data on such a stream first contains compressed | 6 // In each direction, the data on such a stream first contains compressed |
7 // headers then body data. | 7 // headers then body data. |
8 | 8 |
9 #ifndef NET_QUIC_QUIC_SPDY_STREAM_H_ | 9 #ifndef NET_QUIC_QUIC_SPDY_STREAM_H_ |
10 #define NET_QUIC_QUIC_SPDY_STREAM_H_ | 10 #define NET_QUIC_QUIC_SPDY_STREAM_H_ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream { | 45 class NET_EXPORT_PRIVATE QuicSpdyStream : public ReliableQuicStream { |
46 public: | 46 public: |
47 // Visitor receives callbacks from the stream. | 47 // Visitor receives callbacks from the stream. |
48 class NET_EXPORT_PRIVATE Visitor { | 48 class NET_EXPORT_PRIVATE Visitor { |
49 public: | 49 public: |
50 Visitor() {} | 50 Visitor() {} |
51 | 51 |
52 // Called when the stream is closed. | 52 // Called when the stream is closed. |
53 virtual void OnClose(QuicSpdyStream* stream) = 0; | 53 virtual void OnClose(QuicSpdyStream* stream) = 0; |
54 | 54 |
| 55 // Allows subclasses to override and do work. |
| 56 virtual void OnPromiseHeadersComplete(QuicStreamId promised_id, |
| 57 size_t frame_len) {} |
| 58 |
55 protected: | 59 protected: |
56 virtual ~Visitor() {} | 60 virtual ~Visitor() {} |
57 | 61 |
58 private: | 62 private: |
59 DISALLOW_COPY_AND_ASSIGN(Visitor); | 63 DISALLOW_COPY_AND_ASSIGN(Visitor); |
60 }; | 64 }; |
61 | 65 |
62 QuicSpdyStream(QuicStreamId id, QuicSpdySession* spdy_session); | 66 QuicSpdyStream(QuicStreamId id, QuicSpdySession* spdy_session); |
63 ~QuicSpdyStream() override; | 67 ~QuicSpdyStream() override; |
64 | 68 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 size_t WriteTrailers(SpdyHeaderBlock trailer_block, | 133 size_t WriteTrailers(SpdyHeaderBlock trailer_block, |
130 QuicAckListenerInterface* ack_notifier_delegate); | 134 QuicAckListenerInterface* ack_notifier_delegate); |
131 | 135 |
132 // Marks |bytes_consumed| of the headers data as consumed. | 136 // Marks |bytes_consumed| of the headers data as consumed. |
133 void MarkHeadersConsumed(size_t bytes_consumed); | 137 void MarkHeadersConsumed(size_t bytes_consumed); |
134 | 138 |
135 // Marks |bytes_consumed| of the trailers data as consumed. | 139 // Marks |bytes_consumed| of the trailers data as consumed. |
136 void MarkTrailersConsumed(size_t bytes_consumed); | 140 void MarkTrailersConsumed(size_t bytes_consumed); |
137 | 141 |
138 // Clears |header_list_|. | 142 // Clears |header_list_|. |
139 void ConsumeHeaderList() { header_list_.Clear(); } | 143 void ConsumeHeaderList(); |
140 | 144 |
141 // This block of functions wraps the sequencer's functions of the same | 145 // This block of functions wraps the sequencer's functions of the same |
142 // name. These methods return uncompressed data until that has | 146 // name. These methods return uncompressed data until that has |
143 // been fully processed. Then they simply delegate to the sequencer. | 147 // been fully processed. Then they simply delegate to the sequencer. |
144 virtual size_t Readv(const struct iovec* iov, size_t iov_len); | 148 virtual size_t Readv(const struct iovec* iov, size_t iov_len); |
145 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; | 149 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; |
146 void MarkConsumed(size_t num_bytes); | 150 void MarkConsumed(size_t num_bytes); |
147 | 151 |
148 // Returns true if header contains a valid 3-digit status and parse the status | 152 // Returns true if header contains a valid 3-digit status and parse the status |
149 // code to |status_code|. | 153 // code to |status_code|. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 std::string decompressed_trailers_; | 230 std::string decompressed_trailers_; |
227 // The parsed trailers received from the peer. | 231 // The parsed trailers received from the peer. |
228 SpdyHeaderBlock received_trailers_; | 232 SpdyHeaderBlock received_trailers_; |
229 | 233 |
230 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 234 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
231 }; | 235 }; |
232 | 236 |
233 } // namespace net | 237 } // namespace net |
234 | 238 |
235 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 239 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
OLD | NEW |