| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 // 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 |
| 150 // name. These methods return uncompressed data until that has | 150 // name. These methods return uncompressed data until that has |
| 151 // been fully processed. Then they simply delegate to the sequencer. | 151 // been fully processed. Then they simply delegate to the sequencer. |
| 152 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); |
| 153 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; | 153 virtual int GetReadableRegions(iovec* iov, size_t iov_len) const; |
| 154 void MarkConsumed(size_t num_bytes); | 154 void MarkConsumed(size_t num_bytes); |
| 155 | 155 |
| 156 // Returns true if header contains a valid 3-digit status and parse the status | 156 // Returns true if header contains a valid 3-digit status and parse the status |
| 157 // code to |status_code|. | 157 // code to |status_code|. |
| 158 bool ParseHeaderStatusCode(SpdyHeaderBlock* header, int* status_code) const; | 158 bool ParseHeaderStatusCode(const SpdyHeaderBlock& header, |
| 159 int* status_code) const; |
| 159 | 160 |
| 160 // Returns true when all data has been read from the peer, including the fin. | 161 // Returns true when all data has been read from the peer, including the fin. |
| 161 bool IsDoneReading() const; | 162 bool IsDoneReading() const; |
| 162 bool HasBytesToRead() const; | 163 bool HasBytesToRead() const; |
| 163 | 164 |
| 164 void set_visitor(Visitor* visitor) { visitor_ = visitor; } | 165 void set_visitor(Visitor* visitor) { visitor_ = visitor; } |
| 165 | 166 |
| 166 bool headers_decompressed() const { return headers_decompressed_; } | 167 bool headers_decompressed() const { return headers_decompressed_; } |
| 167 | 168 |
| 168 const std::string& decompressed_headers() const { | 169 const std::string& decompressed_headers() const { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 std::string decompressed_trailers_; | 241 std::string decompressed_trailers_; |
| 241 // The parsed trailers received from the peer. | 242 // The parsed trailers received from the peer. |
| 242 SpdyHeaderBlock received_trailers_; | 243 SpdyHeaderBlock received_trailers_; |
| 243 | 244 |
| 244 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 245 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
| 245 }; | 246 }; |
| 246 | 247 |
| 247 } // namespace net | 248 } // namespace net |
| 248 | 249 |
| 249 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 250 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
| OLD | NEW |