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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 const std::string& decompressed_headers() const { | 134 const std::string& decompressed_headers() const { |
135 return decompressed_headers_; | 135 return decompressed_headers_; |
136 } | 136 } |
137 | 137 |
138 bool trailers_decompressed() const { return trailers_decompressed_; } | 138 bool trailers_decompressed() const { return trailers_decompressed_; } |
139 | 139 |
140 const std::string& decompressed_trailers() const { | 140 const std::string& decompressed_trailers() const { |
141 return decompressed_trailers_; | 141 return decompressed_trailers_; |
142 } | 142 } |
143 | 143 |
| 144 // Returns whatever trailers have been received for this stream. |
| 145 const SpdyHeaderBlock& response_trailers() const { |
| 146 return response_trailers_; |
| 147 } |
| 148 |
144 virtual SpdyPriority priority() const; | 149 virtual SpdyPriority priority() const; |
145 | 150 |
146 // Sets priority_ to priority. This should only be called before bytes are | 151 // Sets priority_ to priority. This should only be called before bytes are |
147 // written to the server. | 152 // written to the server. |
148 void SetPriority(SpdyPriority priority); | 153 void SetPriority(SpdyPriority priority); |
149 | 154 |
150 protected: | 155 protected: |
151 // Called by OnStreamHeadersComplete depending on which type (initial or | 156 // Called by OnStreamHeadersComplete depending on which type (initial or |
152 // trailing) headers are expected next. | 157 // trailing) headers are expected next. |
153 virtual void OnInitialHeadersComplete(bool fin, size_t frame_len); | 158 virtual void OnInitialHeadersComplete(bool fin, size_t frame_len); |
(...skipping 21 matching lines...) Expand all Loading... |
175 SpdyPriority priority_; | 180 SpdyPriority priority_; |
176 // Contains a copy of the decompressed headers until they are consumed | 181 // Contains a copy of the decompressed headers until they are consumed |
177 // via ProcessData or Readv. | 182 // via ProcessData or Readv. |
178 std::string decompressed_headers_; | 183 std::string decompressed_headers_; |
179 | 184 |
180 // True if the trailers have been completely decompressed. | 185 // True if the trailers have been completely decompressed. |
181 bool trailers_decompressed_; | 186 bool trailers_decompressed_; |
182 // Contains a copy of the decompressed trailers until they are consumed | 187 // Contains a copy of the decompressed trailers until they are consumed |
183 // via ProcessData or Readv. | 188 // via ProcessData or Readv. |
184 std::string decompressed_trailers_; | 189 std::string decompressed_trailers_; |
| 190 // The parsed trailers received from the peer. |
| 191 SpdyHeaderBlock response_trailers_; |
185 | 192 |
186 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 193 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
187 }; | 194 }; |
188 | 195 |
189 } // namespace net | 196 } // namespace net |
190 | 197 |
191 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 198 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
OLD | NEW |