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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // headers stream. Trailers will always have the FIN set. | 133 // headers stream. Trailers will always have the FIN set. |
134 virtual size_t WriteTrailers(const SpdyHeaderBlock& trailer_block, | 134 virtual size_t WriteTrailers(const SpdyHeaderBlock& trailer_block, |
135 QuicAckListenerInterface* ack_notifier_delegate); | 135 QuicAckListenerInterface* ack_notifier_delegate); |
136 | 136 |
137 // Marks |bytes_consumed| of the headers data as consumed. | 137 // Marks |bytes_consumed| of the headers data as consumed. |
138 void MarkHeadersConsumed(size_t bytes_consumed); | 138 void MarkHeadersConsumed(size_t bytes_consumed); |
139 | 139 |
140 // Marks |bytes_consumed| of the trailers data as consumed. | 140 // Marks |bytes_consumed| of the trailers data as consumed. |
141 void MarkTrailersConsumed(size_t bytes_consumed); | 141 void MarkTrailersConsumed(size_t bytes_consumed); |
142 | 142 |
| 143 // Marks the trailers as consumed. |
| 144 void MarkTrailersDelivered(); |
| 145 |
143 // Clears |header_list_|. | 146 // Clears |header_list_|. |
144 void ConsumeHeaderList(); | 147 void ConsumeHeaderList(); |
145 | 148 |
146 // This block of functions wraps the sequencer's functions of the same | 149 // This block of functions wraps the sequencer's functions of the same |
147 // name. These methods return uncompressed data until that has | 150 // name. These methods return uncompressed data until that has |
148 // been fully processed. Then they simply delegate to the sequencer. | 151 // been fully processed. Then they simply delegate to the sequencer. |
149 virtual size_t Readv(const struct iovec* iov, size_t iov_len); | 152 virtual size_t Readv(const struct iovec* iov, size_t iov_len); |
150 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; | 153 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; |
151 void MarkConsumed(size_t num_bytes); | 154 void MarkConsumed(size_t num_bytes); |
152 | 155 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 SpdyPriority priority_; | 229 SpdyPriority priority_; |
227 // Contains a copy of the decompressed headers until they are consumed | 230 // Contains a copy of the decompressed headers until they are consumed |
228 // via ProcessData or Readv. | 231 // via ProcessData or Readv. |
229 std::string decompressed_headers_; | 232 std::string decompressed_headers_; |
230 // Contains a copy of the decompressed header (name, value) pairs until they | 233 // Contains a copy of the decompressed header (name, value) pairs until they |
231 // are consumed via Readv. | 234 // are consumed via Readv. |
232 QuicHeaderList header_list_; | 235 QuicHeaderList header_list_; |
233 | 236 |
234 // True if the trailers have been completely decompressed. | 237 // True if the trailers have been completely decompressed. |
235 bool trailers_decompressed_; | 238 bool trailers_decompressed_; |
| 239 // True if the trailers have been consumed. |
| 240 bool trailers_delivered_; |
236 // Contains a copy of the decompressed trailers until they are consumed | 241 // Contains a copy of the decompressed trailers until they are consumed |
237 // via ProcessData or Readv. | 242 // via ProcessData or Readv. |
238 std::string decompressed_trailers_; | 243 std::string decompressed_trailers_; |
239 // The parsed trailers received from the peer. | 244 // The parsed trailers received from the peer. |
240 SpdyHeaderBlock received_trailers_; | 245 SpdyHeaderBlock received_trailers_; |
241 | 246 |
242 bool avoid_empty_nonfin_writes_; | 247 bool avoid_empty_nonfin_writes_; |
243 | 248 |
244 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 249 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
245 }; | 250 }; |
246 | 251 |
247 } // namespace net | 252 } // namespace net |
248 | 253 |
249 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 254 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
OLD | NEW |