| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // time a stream is closed and not deleted is in its delegate's | 388 // time a stream is closed and not deleted is in its delegate's |
| 389 // OnClose() method. | 389 // OnClose() method. |
| 390 bool IsClosed() const; | 390 bool IsClosed() const; |
| 391 | 391 |
| 392 // Returns whether the streams local endpoint is closed. | 392 // Returns whether the streams local endpoint is closed. |
| 393 // The remote endpoint may still be active. | 393 // The remote endpoint may still be active. |
| 394 bool IsLocallyClosed() const; | 394 bool IsLocallyClosed() const; |
| 395 | 395 |
| 396 // Returns whether this stream is IDLE: request and response headers | 396 // Returns whether this stream is IDLE: request and response headers |
| 397 // have neither been sent nor receieved. | 397 // have neither been sent nor receieved. |
| 398 // TODO(jgraettinger): Renamed to force compilation error & semantics | 398 bool IsIdle() const; |
| 399 // update at call sites. Undo this. | |
| 400 bool IsIdleTemporaryRename() const; | |
| 401 | 399 |
| 402 // Returns whether or not this stream is fully open: that request and | 400 // Returns whether or not this stream is fully open: that request and |
| 403 // response headers are complete, and it is not in a half-closed state. | 401 // response headers are complete, and it is not in a half-closed state. |
| 404 bool IsOpen() const; | 402 bool IsOpen() const; |
| 405 | 403 |
| 406 // Returns the protocol used by this stream. Always between | 404 // Returns the protocol used by this stream. Always between |
| 407 // kProtoSPDYMinimumVersion and kProtoSPDYMaximumVersion. | 405 // kProtoSPDYMinimumVersion and kProtoSPDYMaximumVersion. |
| 408 NextProto GetProtocol() const; | 406 NextProto GetProtocol() const; |
| 409 | 407 |
| 410 int response_status() const { return response_status_; } | 408 int response_status() const { return response_status_; } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 437 class SynStreamBufferProducer; | 435 class SynStreamBufferProducer; |
| 438 class HeaderBufferProducer; | 436 class HeaderBufferProducer; |
| 439 | 437 |
| 440 // SpdyStream states and transitions are modeled | 438 // SpdyStream states and transitions are modeled |
| 441 // on the HTTP/2 stream state machine. All states and transitions | 439 // on the HTTP/2 stream state machine. All states and transitions |
| 442 // are modeled, with the exceptions of RESERVED_LOCAL (the client | 440 // are modeled, with the exceptions of RESERVED_LOCAL (the client |
| 443 // cannot initate push streams), and the transition to OPEN due to | 441 // cannot initate push streams), and the transition to OPEN due to |
| 444 // a remote SYN_STREAM (the client can only initate streams). | 442 // a remote SYN_STREAM (the client can only initate streams). |
| 445 // TODO(jgraettinger): RESERVED_REMOTE must be added to the state | 443 // TODO(jgraettinger): RESERVED_REMOTE must be added to the state |
| 446 // machine when PUSH_PROMISE is implemented. | 444 // machine when PUSH_PROMISE is implemented. |
| 447 // TODO(jgraettinger): HALF_CLOSED_REMOTE must be added to the state | |
| 448 // machine to support remotely closed, ongoing sends. | |
| 449 enum State { | 445 enum State { |
| 450 STATE_IDLE, | 446 STATE_IDLE, |
| 451 STATE_OPEN, | 447 STATE_OPEN, |
| 452 STATE_HALF_CLOSED_LOCAL_UNCLAIMED, | 448 STATE_HALF_CLOSED_LOCAL_UNCLAIMED, |
| 453 STATE_HALF_CLOSED_LOCAL, | 449 STATE_HALF_CLOSED_LOCAL, |
| 450 STATE_HALF_CLOSED_REMOTE, |
| 454 STATE_CLOSED, | 451 STATE_CLOSED, |
| 455 }; | 452 }; |
| 456 | 453 |
| 457 // Update the histograms. Can safely be called repeatedly, but should only | 454 // Update the histograms. Can safely be called repeatedly, but should only |
| 458 // be called after the stream has completed. | 455 // be called after the stream has completed. |
| 459 void UpdateHistograms(); | 456 void UpdateHistograms(); |
| 460 | 457 |
| 461 // When a server-push stream is claimed by SetDelegate(), this function is | 458 // When a server-push stream is claimed by SetDelegate(), this function is |
| 462 // posted on the current MessageLoop to replay everything the server has sent. | 459 // posted on the current MessageLoop to replay everything the server has sent. |
| 463 // From the perspective of SpdyStream's state machine, headers, data, and | 460 // From the perspective of SpdyStream's state machine, headers, data, and |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 std::string domain_bound_private_key_; | 556 std::string domain_bound_private_key_; |
| 560 std::string domain_bound_cert_; | 557 std::string domain_bound_cert_; |
| 561 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_; | 558 ServerBoundCertService::RequestHandle domain_bound_cert_request_handle_; |
| 562 | 559 |
| 563 DISALLOW_COPY_AND_ASSIGN(SpdyStream); | 560 DISALLOW_COPY_AND_ASSIGN(SpdyStream); |
| 564 }; | 561 }; |
| 565 | 562 |
| 566 } // namespace net | 563 } // namespace net |
| 567 | 564 |
| 568 #endif // NET_SPDY_SPDY_STREAM_H_ | 565 #endif // NET_SPDY_SPDY_STREAM_H_ |
| OLD | NEW |