| 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 QuicAckListenerInterface* ack_notifier_delegate); | 133 QuicAckListenerInterface* ack_notifier_delegate); |
| 134 | 134 |
| 135 // Writes the trailers contained in |trailer_block| to the dedicated | 135 // Writes the trailers contained in |trailer_block| to the dedicated |
| 136 // headers stream. Trailers will always have the FIN set. | 136 // headers stream. Trailers will always have the FIN set. |
| 137 virtual size_t WriteTrailers(SpdyHeaderBlock trailer_block, | 137 virtual size_t WriteTrailers(SpdyHeaderBlock trailer_block, |
| 138 QuicAckListenerInterface* ack_notifier_delegate); | 138 QuicAckListenerInterface* ack_notifier_delegate); |
| 139 | 139 |
| 140 // Marks |bytes_consumed| of the headers data as consumed. | 140 // Marks |bytes_consumed| of the headers data as consumed. |
| 141 void MarkHeadersConsumed(size_t bytes_consumed); | 141 void MarkHeadersConsumed(size_t bytes_consumed); |
| 142 | 142 |
| 143 // Marks |bytes_consumed| of the trailers data as consumed. | 143 // Marks |bytes_consumed| of the trailers data as consumed. This applies to |
| 144 // the case where this object receives headers and trailers data via calls to |
| 145 // OnStreamHeaders(). |
| 144 void MarkTrailersConsumed(size_t bytes_consumed); | 146 void MarkTrailersConsumed(size_t bytes_consumed); |
| 145 | 147 |
| 146 // Marks the trailers as consumed. | 148 // Marks the trailers as consumed. This applies to the case where this object |
| 147 void MarkTrailersDelivered(); | 149 // receives headers and trailers as QuicHeaderLists via calls to |
| 150 // OnStreamHeaderList(). |
| 151 void MarkTrailersConsumed(); |
| 148 | 152 |
| 149 // Clears |header_list_|. | 153 // Clears |header_list_|. |
| 150 void ConsumeHeaderList(); | 154 void ConsumeHeaderList(); |
| 151 | 155 |
| 152 // This block of functions wraps the sequencer's functions of the same | 156 // This block of functions wraps the sequencer's functions of the same |
| 153 // name. These methods return uncompressed data until that has | 157 // name. These methods return uncompressed data until that has |
| 154 // been fully processed. Then they simply delegate to the sequencer. | 158 // been fully processed. Then they simply delegate to the sequencer. |
| 155 virtual size_t Readv(const struct iovec* iov, size_t iov_len); | 159 virtual size_t Readv(const struct iovec* iov, size_t iov_len); |
| 156 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; | 160 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; |
| 157 void MarkConsumed(size_t num_bytes); | 161 void MarkConsumed(size_t num_bytes); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // Contains a copy of the decompressed headers until they are consumed | 247 // Contains a copy of the decompressed headers until they are consumed |
| 244 // via ProcessData or Readv. | 248 // via ProcessData or Readv. |
| 245 std::string decompressed_headers_; | 249 std::string decompressed_headers_; |
| 246 // Contains a copy of the decompressed header (name, value) pairs until they | 250 // Contains a copy of the decompressed header (name, value) pairs until they |
| 247 // are consumed via Readv. | 251 // are consumed via Readv. |
| 248 QuicHeaderList header_list_; | 252 QuicHeaderList header_list_; |
| 249 | 253 |
| 250 // True if the trailers have been completely decompressed. | 254 // True if the trailers have been completely decompressed. |
| 251 bool trailers_decompressed_; | 255 bool trailers_decompressed_; |
| 252 // True if the trailers have been consumed. | 256 // True if the trailers have been consumed. |
| 253 bool trailers_delivered_; | 257 bool trailers_consumed_; |
| 254 // Contains a copy of the decompressed trailers until they are consumed | 258 // Contains a copy of the decompressed trailers until they are consumed |
| 255 // via ProcessData or Readv. | 259 // via ProcessData or Readv. |
| 256 std::string decompressed_trailers_; | 260 std::string decompressed_trailers_; |
| 257 // The parsed trailers received from the peer. | 261 // The parsed trailers received from the peer. |
| 258 SpdyHeaderBlock received_trailers_; | 262 SpdyHeaderBlock received_trailers_; |
| 259 | 263 |
| 260 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 264 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
| 261 }; | 265 }; |
| 262 | 266 |
| 263 } // namespace net | 267 } // namespace net |
| 264 | 268 |
| 265 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 269 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
| OLD | NEW |