OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_SPDY_SPDY_STREAM_H_ | 5 #ifndef NET_SPDY_SPDY_STREAM_H_ |
6 #define NET_SPDY_SPDY_STREAM_H_ | 6 #define NET_SPDY_SPDY_STREAM_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 // Called by the SpdySession (only after | 295 // Called by the SpdySession (only after |
296 // OnInitialResponseHeadersReceived() has been called) when | 296 // OnInitialResponseHeadersReceived() has been called) when |
297 // late-bound headers are received for a stream. Returns a status | 297 // late-bound headers are received for a stream. Returns a status |
298 // code; if it is an error, the stream was closed by this function. | 298 // code; if it is an error, the stream was closed by this function. |
299 int OnAdditionalResponseHeadersReceived( | 299 int OnAdditionalResponseHeadersReceived( |
300 const SpdyHeaderBlock& additional_response_headers); | 300 const SpdyHeaderBlock& additional_response_headers); |
301 | 301 |
302 // Called by the SpdySession when a frame carrying request headers opening a | 302 // Called by the SpdySession when a frame carrying request headers opening a |
303 // push stream is received. Stream transits to STATE_RESERVED_REMOTE state. | 303 // push stream is received. Stream transits to STATE_RESERVED_REMOTE state. |
304 // Returns a status code; if it is an error, the stream was closed by this | 304 void OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers); |
305 // function. | |
306 int OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers); | |
307 | 305 |
308 // Called by the SpdySession when response data has been received | 306 // Called by the SpdySession when response data has been received |
309 // for this stream. This callback may be called multiple times as | 307 // for this stream. This callback may be called multiple times as |
310 // data arrives from the network, and will never be called prior to | 308 // data arrives from the network, and will never be called prior to |
311 // OnResponseHeadersReceived. | 309 // OnResponseHeadersReceived. |
312 // | 310 // |
313 // |buffer| contains the data received, or NULL if the stream is | 311 // |buffer| contains the data received, or NULL if the stream is |
314 // being closed. The stream must copy any data from this | 312 // being closed. The stream must copy any data from this |
315 // buffer before returning from this callback. | 313 // buffer before returning from this callback. |
316 // | 314 // |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 bool IsLocallyClosed() const; | 397 bool IsLocallyClosed() const; |
400 | 398 |
401 // Returns whether this stream is IDLE: request and response headers | 399 // Returns whether this stream is IDLE: request and response headers |
402 // have neither been sent nor receieved. | 400 // have neither been sent nor receieved. |
403 bool IsIdle() const; | 401 bool IsIdle() const; |
404 | 402 |
405 // Returns whether or not this stream is fully open: that request and | 403 // Returns whether or not this stream is fully open: that request and |
406 // response headers are complete, and it is not in a half-closed state. | 404 // response headers are complete, and it is not in a half-closed state. |
407 bool IsOpen() const; | 405 bool IsOpen() const; |
408 | 406 |
| 407 // Returns whether the stream is reserved by remote endpoint: server has sent |
| 408 // intended request headers for a pushed stream, but haven't started response |
| 409 // yet. |
| 410 bool IsReservedRemote() const; |
| 411 |
409 // Returns the protocol used by this stream. Always between | 412 // Returns the protocol used by this stream. Always between |
410 // kProtoSPDYMinimumVersion and kProtoSPDYMaximumVersion. | 413 // kProtoSPDYMinimumVersion and kProtoSPDYMaximumVersion. |
411 NextProto GetProtocol() const; | 414 NextProto GetProtocol() const; |
412 | 415 |
413 int response_status() const { return response_status_; } | 416 int response_status() const { return response_status_; } |
414 | 417 |
415 void IncrementRawReceivedBytes(size_t received_bytes) { | 418 void IncrementRawReceivedBytes(size_t received_bytes) { |
416 raw_received_bytes_ += received_bytes; | 419 raw_received_bytes_ += received_bytes; |
417 } | 420 } |
418 | 421 |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 bool write_handler_guard_; | 568 bool write_handler_guard_; |
566 | 569 |
567 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; | 570 base::WeakPtrFactory<SpdyStream> weak_ptr_factory_; |
568 | 571 |
569 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 572 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
570 }; | 573 }; |
571 | 574 |
572 } // namespace net | 575 } // namespace net |
573 | 576 |
574 #endif // NET_SPDY_SPDY_STREAM_H_ | 577 #endif // NET_SPDY_SPDY_STREAM_H_ |
OLD | NEW |