Chromium Code Reviews| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 const std::string& decompressed_trailers() const { | 144 const std::string& decompressed_trailers() const { |
| 145 return decompressed_trailers_; | 145 return decompressed_trailers_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 SpdyPriority priority() const { return priority_; } | 148 SpdyPriority priority() const { return priority_; } |
| 149 | 149 |
| 150 // Sets priority_ to priority. This should only be called before bytes are | 150 // Sets priority_ to priority. This should only be called before bytes are |
| 151 // written to the server. | 151 // written to the server. |
| 152 void SetPriority(SpdyPriority priority); | 152 void SetPriority(SpdyPriority priority); |
| 153 | 153 |
| 154 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 155 void CrashIfInvalid() const; | |
| 156 void set_read_is_progress(bool value) { read_is_progress_ = value; } | |
|
eroman
2016/02/12 21:12:43
read_in_progress
ramant (doing other things)
2016/02/13 00:14:19
Done.
| |
| 157 | |
| 154 protected: | 158 protected: |
| 155 // Called by OnStreamHeadersComplete depending on which type (initial or | 159 // Called by OnStreamHeadersComplete depending on which type (initial or |
| 156 // trailing) headers are expected next. | 160 // trailing) headers are expected next. |
| 157 virtual void OnInitialHeadersComplete(bool fin, size_t frame_len); | 161 virtual void OnInitialHeadersComplete(bool fin, size_t frame_len); |
| 158 virtual void OnTrailingHeadersComplete(bool fin, size_t frame_len); | 162 virtual void OnTrailingHeadersComplete(bool fin, size_t frame_len); |
| 159 QuicSpdySession* spdy_session() const { return spdy_session_; } | 163 QuicSpdySession* spdy_session() const { return spdy_session_; } |
| 160 Visitor* visitor() { return visitor_; } | 164 Visitor* visitor() { return visitor_; } |
| 161 | 165 |
| 162 // Returns true if headers have been fully read and consumed. | 166 // Returns true if headers have been fully read and consumed. |
| 163 bool FinishedReadingHeaders() const; | 167 bool FinishedReadingHeaders() const; |
| 164 | 168 |
| 165 private: | 169 private: |
| 166 friend class test::QuicSpdyStreamPeer; | 170 friend class test::QuicSpdyStreamPeer; |
| 167 friend class test::ReliableQuicStreamPeer; | 171 friend class test::ReliableQuicStreamPeer; |
| 168 friend class QuicStreamUtils; | 172 friend class QuicStreamUtils; |
| 169 | 173 |
| 174 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 175 enum Liveness { | |
| 176 ALIVE = 0xCA11AB13, | |
| 177 DEAD = 0xDEADBEEF, | |
| 178 }; | |
| 179 | |
| 170 // Returns true if trailers have been fully read and consumed. | 180 // Returns true if trailers have been fully read and consumed. |
| 171 bool FinishedReadingTrailers() const; | 181 bool FinishedReadingTrailers() const; |
| 172 | 182 |
| 173 QuicSpdySession* spdy_session_; | 183 QuicSpdySession* spdy_session_; |
| 174 | 184 |
| 175 Visitor* visitor_; | 185 Visitor* visitor_; |
| 176 // True if the headers have been completely decompressed. | 186 // True if the headers have been completely decompressed. |
| 177 bool headers_decompressed_; | 187 bool headers_decompressed_; |
| 178 // The priority of the stream, once parsed. | 188 // The priority of the stream, once parsed. |
| 179 SpdyPriority priority_; | 189 SpdyPriority priority_; |
| 180 // Contains a copy of the decompressed headers until they are consumed | 190 // Contains a copy of the decompressed headers until they are consumed |
| 181 // via ProcessData or Readv. | 191 // via ProcessData or Readv. |
| 182 std::string decompressed_headers_; | 192 std::string decompressed_headers_; |
| 183 | 193 |
| 184 // True if the trailers have been completely decompressed. | 194 // True if the trailers have been completely decompressed. |
| 185 bool trailers_decompressed_; | 195 bool trailers_decompressed_; |
| 186 // Contains a copy of the decompressed trailers until they are consumed | 196 // Contains a copy of the decompressed trailers until they are consumed |
| 187 // via ProcessData or Readv. | 197 // via ProcessData or Readv. |
| 188 std::string decompressed_trailers_; | 198 std::string decompressed_trailers_; |
| 189 | 199 |
| 200 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 201 Liveness liveness_ = ALIVE; | |
| 202 bool read_is_progress_ = false; | |
| 203 | |
| 190 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); | 204 DISALLOW_COPY_AND_ASSIGN(QuicSpdyStream); |
| 191 }; | 205 }; |
| 192 | 206 |
| 193 } // namespace net | 207 } // namespace net |
| 194 | 208 |
| 195 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ | 209 #endif // NET_QUIC_QUIC_SPDY_STREAM_H_ |
| OLD | NEW |