| 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_CORE_QUIC_SPDY_STREAM_H_ | 9 #ifndef NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| 10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 10 #define NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 void SetPriority(SpdyPriority priority); | 167 void SetPriority(SpdyPriority priority); |
| 168 | 168 |
| 169 // Called when owning session is getting deleted to avoid subsequent | 169 // Called when owning session is getting deleted to avoid subsequent |
| 170 // use of the spdy_session_ member. | 170 // use of the spdy_session_ member. |
| 171 void ClearSession(); | 171 void ClearSession(); |
| 172 | 172 |
| 173 // Returns true if the sequencer has delivered the FIN, and no more body bytes | 173 // Returns true if the sequencer has delivered the FIN, and no more body bytes |
| 174 // will be available. | 174 // will be available. |
| 175 bool IsClosed() { return sequencer()->IsClosed(); } | 175 bool IsClosed() { return sequencer()->IsClosed(); } |
| 176 | 176 |
| 177 void set_allow_bidirectional_data(bool value) { | |
| 178 allow_bidirectional_data_ = value; | |
| 179 } | |
| 180 | |
| 181 bool allow_bidirectional_data() const { | |
| 182 return FLAGS_quic_reloadable_flag_quic_always_enable_bidi_streaming || | |
| 183 allow_bidirectional_data_; | |
| 184 } | |
| 185 | |
| 186 using QuicStream::CloseWriteSide; | 177 using QuicStream::CloseWriteSide; |
| 187 | 178 |
| 188 protected: | 179 protected: |
| 189 virtual void OnInitialHeadersComplete(bool fin, | 180 virtual void OnInitialHeadersComplete(bool fin, |
| 190 size_t frame_len, | 181 size_t frame_len, |
| 191 const QuicHeaderList& header_list); | 182 const QuicHeaderList& header_list); |
| 192 virtual void OnTrailingHeadersComplete(bool fin, | 183 virtual void OnTrailingHeadersComplete(bool fin, |
| 193 size_t frame_len, | 184 size_t frame_len, |
| 194 const QuicHeaderList& header_list); | 185 const QuicHeaderList& header_list); |
| 195 QuicSpdySession* spdy_session() const { return spdy_session_; } | 186 QuicSpdySession* spdy_session() const { return spdy_session_; } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 207 void set_headers_decompressed(bool val) { headers_decompressed_ = val; } | 198 void set_headers_decompressed(bool val) { headers_decompressed_ = val; } |
| 208 | 199 |
| 209 private: | 200 private: |
| 210 friend class test::QuicSpdyStreamPeer; | 201 friend class test::QuicSpdyStreamPeer; |
| 211 friend class test::QuicStreamPeer; | 202 friend class test::QuicStreamPeer; |
| 212 friend class QuicStreamUtils; | 203 friend class QuicStreamUtils; |
| 213 | 204 |
| 214 QuicSpdySession* spdy_session_; | 205 QuicSpdySession* spdy_session_; |
| 215 | 206 |
| 216 Visitor* visitor_; | 207 Visitor* visitor_; |
| 217 // If true, allow sending of a request to continue while the response is | |
| 218 // arriving. | |
| 219 bool allow_bidirectional_data_; | |
| 220 // True if the headers have been completely decompressed. | 208 // True if the headers have been completely decompressed. |
| 221 bool headers_decompressed_; | 209 bool headers_decompressed_; |
| 222 // The priority of the stream, once parsed. | 210 // The priority of the stream, once parsed. |
| 223 SpdyPriority priority_; | 211 SpdyPriority priority_; |
| 224 // Contains a copy of the decompressed header (name, value) pairs until they | 212 // Contains a copy of the decompressed header (name, value) pairs until they |
| 225 // are consumed via Readv. | 213 // are consumed via Readv. |
| 226 QuicHeaderList header_list_; | 214 QuicHeaderList header_list_; |
| 227 | 215 |
| 228 // True if the trailers have been completely decompressed. | 216 // True if the trailers have been completely decompressed. |
| 229 bool trailers_decompressed_; | 217 bool trailers_decompressed_; |
| 230 // True if the trailers have been consumed. | 218 // True if the trailers have been consumed. |
| 231 bool trailers_consumed_; | 219 bool trailers_consumed_; |
| 232 // The parsed trailers received from the peer. | 220 // The parsed trailers received from the peer. |
| 233 SpdyHeaderBlock received_trailers_; | 221 SpdyHeaderBlock received_trailers_; |
| 234 | 222 |
| 235 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 223 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
| 236 }; | 224 }; |
| 237 | 225 |
| 238 } // namespace net | 226 } // namespace net |
| 239 | 227 |
| 240 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ | 228 #endif // NET_QUIC_CORE_QUIC_SPDY_STREAM_H_ |
| OLD | NEW |