| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 friend class SpdyProxyClientSocketTest; | 566 friend class SpdyProxyClientSocketTest; |
| 567 friend class SpdySessionTest; | 567 friend class SpdySessionTest; |
| 568 friend class SpdyStreamRequest; | 568 friend class SpdyStreamRequest; |
| 569 | 569 |
| 570 // Allow tests to access our innards for testing purposes. | 570 // Allow tests to access our innards for testing purposes. |
| 571 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ClientPing); | 571 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ClientPing); |
| 572 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, FailedPing); | 572 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, FailedPing); |
| 573 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GetActivePushStream); | 573 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GetActivePushStream); |
| 574 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, DeleteExpiredPushStreams); | 574 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, DeleteExpiredPushStreams); |
| 575 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, MetricsCollectionOnPushStreams); | 575 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, MetricsCollectionOnPushStreams); |
| 576 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, CancelPushBeforeClaimed); |
| 577 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, CancelPushAfterExpired); |
| 576 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ProtocolNegotiation); | 578 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ProtocolNegotiation); |
| 577 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ClearSettings); | 579 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ClearSettings); |
| 578 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, AdjustRecvWindowSize); | 580 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, AdjustRecvWindowSize); |
| 579 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, AdjustSendWindowSize); | 581 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, AdjustSendWindowSize); |
| 580 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlInactiveStream); | 582 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlInactiveStream); |
| 581 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlPadding); | 583 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlPadding); |
| 582 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 584 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
| 583 SessionFlowControlTooMuchDataTwoDataFrames); | 585 SessionFlowControlTooMuchDataTwoDataFrames); |
| 584 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 586 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
| 585 StreamFlowControlTooMuchDataTwoDataFrames); | 587 StreamFlowControlTooMuchDataTwoDataFrames); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 // Called when there is room to create more streams (e.g., a stream | 670 // Called when there is room to create more streams (e.g., a stream |
| 669 // was closed). Processes as many pending stream requests as | 671 // was closed). Processes as many pending stream requests as |
| 670 // possible. | 672 // possible. |
| 671 void ProcessPendingStreamRequests(); | 673 void ProcessPendingStreamRequests(); |
| 672 | 674 |
| 673 bool TryCreatePushStream(SpdyStreamId stream_id, | 675 bool TryCreatePushStream(SpdyStreamId stream_id, |
| 674 SpdyStreamId associated_stream_id, | 676 SpdyStreamId associated_stream_id, |
| 675 SpdyPriority priority, | 677 SpdyPriority priority, |
| 676 SpdyHeaderBlock headers); | 678 SpdyHeaderBlock headers); |
| 677 | 679 |
| 680 // Called when the pushed stream should be cancelled. If the pushed stream is |
| 681 // not claimed and active, sends RST to the server to cancel the stream. |
| 682 void CancelPush(const GURL& url); |
| 683 |
| 678 // Close the stream pointed to by the given iterator. Note that that | 684 // Close the stream pointed to by the given iterator. Note that that |
| 679 // stream may hold the last reference to the session. | 685 // stream may hold the last reference to the session. |
| 680 void CloseActiveStreamIterator(ActiveStreamMap::iterator it, int status); | 686 void CloseActiveStreamIterator(ActiveStreamMap::iterator it, int status); |
| 681 | 687 |
| 682 // Close the stream pointed to by the given iterator. Note that that | 688 // Close the stream pointed to by the given iterator. Note that that |
| 683 // stream may hold the last reference to the session. | 689 // stream may hold the last reference to the session. |
| 684 void CloseCreatedStreamIterator(CreatedStreamSet::iterator it, int status); | 690 void CloseCreatedStreamIterator(CreatedStreamSet::iterator it, int status); |
| 685 | 691 |
| 686 // Calls EnqueueResetStreamFrame() and then | 692 // Calls EnqueueResetStreamFrame() and then |
| 687 // CloseActiveStreamIterator(). | 693 // CloseActiveStreamIterator(). |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 // Used for posting asynchronous IO tasks. We use this even though | 1213 // Used for posting asynchronous IO tasks. We use this even though |
| 1208 // SpdySession is refcounted because we don't need to keep the SpdySession | 1214 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1209 // alive if the last reference is within a RunnableMethod. Just revoke the | 1215 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1210 // method. | 1216 // method. |
| 1211 base::WeakPtrFactory<SpdySession> weak_factory_; | 1217 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1212 }; | 1218 }; |
| 1213 | 1219 |
| 1214 } // namespace net | 1220 } // namespace net |
| 1215 | 1221 |
| 1216 #endif // NET_SPDY_SPDY_SESSION_H_ | 1222 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |