| 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_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
| 6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 // Returns the ServerBoundCertService used by this Socket, or NULL | 310 // Returns the ServerBoundCertService used by this Socket, or NULL |
| 311 // if server bound certs are not supported in this session. | 311 // if server bound certs are not supported in this session. |
| 312 ServerBoundCertService* GetServerBoundCertService() const; | 312 ServerBoundCertService* GetServerBoundCertService() const; |
| 313 | 313 |
| 314 // Send a WINDOW_UPDATE frame for a stream. Called by a stream | 314 // Send a WINDOW_UPDATE frame for a stream. Called by a stream |
| 315 // whenever receive window size is increased. | 315 // whenever receive window size is increased. |
| 316 void SendStreamWindowUpdate(SpdyStreamId stream_id, | 316 void SendStreamWindowUpdate(SpdyStreamId stream_id, |
| 317 uint32 delta_window_size); | 317 uint32 delta_window_size); |
| 318 | 318 |
| 319 // Called by a stream to increase this session's receive window size | |
| 320 // by |delta_window_size|, which must be at least 1 and must not | |
| 321 // cause this session's receive window size to overflow, possibly | |
| 322 // also sending a WINDOW_UPDATE frame. Does nothing if session flow | |
| 323 // control is turned off. | |
| 324 void IncreaseRecvWindowSize(int32 delta_window_size); | |
| 325 | |
| 326 // If session is closed, no new streams/transactions should be created. | 319 // If session is closed, no new streams/transactions should be created. |
| 327 bool IsClosed() const { return state_ == STATE_CLOSED; } | 320 bool IsClosed() const { return state_ == STATE_CLOSED; } |
| 328 | 321 |
| 329 // Closes this session. This will close all active streams and mark | 322 // Closes this session. This will close all active streams and mark |
| 330 // the session as permanently closed. | 323 // the session as permanently closed. |
| 331 // |err| should not be OK; this function is intended to be called on | 324 // |err| should not be OK; this function is intended to be called on |
| 332 // error. | 325 // error. |
| 333 // |remove_from_pool| indicates whether to also remove the session from the | 326 // |remove_from_pool| indicates whether to also remove the session from the |
| 334 // session pool. | 327 // session pool. |
| 335 // |description| indicates the reason for the error. | 328 // |description| indicates the reason for the error. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, GetActivePushStream); | 456 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, GetActivePushStream); |
| 464 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, DeleteExpiredPushStreams); | 457 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, DeleteExpiredPushStreams); |
| 465 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation); | 458 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation); |
| 466 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation31); | 459 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation31); |
| 467 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation4); | 460 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, ProtocolNegotiation4); |
| 468 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, IncreaseRecvWindowSize); | 461 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, IncreaseRecvWindowSize); |
| 469 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, AdjustRecvWindowSize31); | 462 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, AdjustRecvWindowSize31); |
| 470 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, AdjustSendWindowSize31); | 463 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, AdjustSendWindowSize31); |
| 471 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, | 464 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, |
| 472 SessionFlowControlInactiveStream31); | 465 SessionFlowControlInactiveStream31); |
| 466 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, |
| 467 SessionFlowControlNoReceiveLeaks31); |
| 473 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, SessionFlowControlEndToEnd31); | 468 FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, SessionFlowControlEndToEnd31); |
| 474 | 469 |
| 475 typedef std::deque<SpdyStreamRequest*> PendingStreamRequestQueue; | 470 typedef std::deque<SpdyStreamRequest*> PendingStreamRequestQueue; |
| 476 typedef std::set<SpdyStreamRequest*> PendingStreamRequestCompletionSet; | 471 typedef std::set<SpdyStreamRequest*> PendingStreamRequestCompletionSet; |
| 477 | 472 |
| 478 typedef std::map<int, scoped_refptr<SpdyStream> > ActiveStreamMap; | 473 typedef std::map<int, scoped_refptr<SpdyStream> > ActiveStreamMap; |
| 479 typedef std::map<std::string, | 474 typedef std::map<std::string, |
| 480 std::pair<scoped_refptr<SpdyStream>, base::TimeTicks> > PushedStreamMap; | 475 std::pair<scoped_refptr<SpdyStream>, base::TimeTicks> > PushedStreamMap; |
| 481 | 476 |
| 482 typedef std::set<scoped_refptr<SpdyStream> > CreatedStreamSet; | 477 typedef std::set<scoped_refptr<SpdyStream> > CreatedStreamSet; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 // empty. | 672 // empty. |
| 678 SpdyStreamId PopStreamToPossiblyResume(); | 673 SpdyStreamId PopStreamToPossiblyResume(); |
| 679 | 674 |
| 680 // If session flow control is turned on, called by CreateDataFrame() | 675 // If session flow control is turned on, called by CreateDataFrame() |
| 681 // (which is in turn called by a stream) to decrease this session's | 676 // (which is in turn called by a stream) to decrease this session's |
| 682 // send window size by |delta_window_size|, which must be at least 1 | 677 // send window size by |delta_window_size|, which must be at least 1 |
| 683 // and at most kMaxSpdyFrameChunkSize. |delta_window_size| must not | 678 // and at most kMaxSpdyFrameChunkSize. |delta_window_size| must not |
| 684 // cause this session's send window size to go negative. | 679 // cause this session's send window size to go negative. |
| 685 void DecreaseSendWindowSize(int32 delta_window_size); | 680 void DecreaseSendWindowSize(int32 delta_window_size); |
| 686 | 681 |
| 682 // Called by SpdyBuffers (via ConsumeCallbacks) to increase this |
| 683 // session's receive window size by |delta_window_size|, which must |
| 684 // be at least 1 and must not cause this session's receive window |
| 685 // size to overflow, possibly also sending a WINDOW_UPDATE |
| 686 // frame. Also called during initialization to set the initial |
| 687 // receive window size. Does nothing if session flow control is |
| 688 // turned off. |
| 689 void IncreaseRecvWindowSize(size_t delta_window_size); |
| 690 |
| 687 // If session flow control is turned on, called by OnStreamFrameData | 691 // If session flow control is turned on, called by OnStreamFrameData |
| 688 // (which is in turn called by the framer) to decrease this | 692 // (which is in turn called by the framer) to decrease this |
| 689 // session's receive window size by |delta_window_size|, which must | 693 // session's receive window size by |delta_window_size|, which must |
| 690 // be at least 1 and must not cause this session's receive window | 694 // be at least 1 and must not cause this session's receive window |
| 691 // size to go negative. | 695 // size to go negative. |
| 692 void DecreaseRecvWindowSize(int32 delta_window_size); | 696 void DecreaseRecvWindowSize(int32 delta_window_size); |
| 693 | 697 |
| 694 // -------------------------- | 698 // -------------------------- |
| 695 // Helper methods for testing | 699 // Helper methods for testing |
| 696 // -------------------------- | 700 // -------------------------- |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 // This SPDY proxy is allowed to push resources from origins that are | 911 // This SPDY proxy is allowed to push resources from origins that are |
| 908 // different from those of their associated streams. | 912 // different from those of their associated streams. |
| 909 HostPortPair trusted_spdy_proxy_; | 913 HostPortPair trusted_spdy_proxy_; |
| 910 | 914 |
| 911 TimeFunc time_func_; | 915 TimeFunc time_func_; |
| 912 }; | 916 }; |
| 913 | 917 |
| 914 } // namespace net | 918 } // namespace net |
| 915 | 919 |
| 916 #endif // NET_SPDY_SPDY_SESSION_H_ | 920 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |