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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlInactiveStream); | 528 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlInactiveStream); |
529 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlPadding); | 529 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlPadding); |
530 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 530 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
531 SessionFlowControlTooMuchDataTwoDataFrames); | 531 SessionFlowControlTooMuchDataTwoDataFrames); |
532 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 532 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
533 StreamFlowControlTooMuchDataTwoDataFrames); | 533 StreamFlowControlTooMuchDataTwoDataFrames); |
534 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlNoReceiveLeaks); | 534 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlNoReceiveLeaks); |
535 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlNoSendLeaks); | 535 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlNoSendLeaks); |
536 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlEndToEnd); | 536 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, SessionFlowControlEndToEnd); |
537 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, StreamIdSpaceExhausted); | 537 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, StreamIdSpaceExhausted); |
| 538 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, MaxConcurrentStreamsZero); |
538 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, UnstallRacesWithStreamCreation); | 539 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, UnstallRacesWithStreamCreation); |
539 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GoAwayOnSessionFlowControlError); | 540 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, GoAwayOnSessionFlowControlError); |
540 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 541 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
541 RejectPushedStreamExceedingConcurrencyLimit); | 542 RejectPushedStreamExceedingConcurrencyLimit); |
542 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, IgnoreReservedRemoteStreamsCount); | 543 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, IgnoreReservedRemoteStreamsCount); |
543 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, | 544 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, |
544 CancelReservedStreamOnHeadersReceived); | 545 CancelReservedStreamOnHeadersReceived); |
545 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, RejectInvalidUnknownFrames); | 546 FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, RejectInvalidUnknownFrames); |
546 FRIEND_TEST_ALL_PREFIXES(SpdySessionPoolTest, IPAddressChanged); | 547 FRIEND_TEST_ALL_PREFIXES(SpdySessionPoolTest, IPAddressChanged); |
547 | 548 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 } | 947 } |
947 | 948 |
948 int64_t pings_in_flight() const { return pings_in_flight_; } | 949 int64_t pings_in_flight() const { return pings_in_flight_; } |
949 | 950 |
950 SpdyPingId next_ping_id() const { return next_ping_id_; } | 951 SpdyPingId next_ping_id() const { return next_ping_id_; } |
951 | 952 |
952 base::TimeTicks last_activity_time() const { return last_activity_time_; } | 953 base::TimeTicks last_activity_time() const { return last_activity_time_; } |
953 | 954 |
954 bool check_ping_status_pending() const { return check_ping_status_pending_; } | 955 bool check_ping_status_pending() const { return check_ping_status_pending_; } |
955 | 956 |
956 size_t max_concurrent_streams() const { return max_concurrent_streams_; } | |
957 | |
958 // Set whether priority->dependency conversion is enabled | 957 // Set whether priority->dependency conversion is enabled |
959 // by default for all future SpdySessions. | 958 // by default for all future SpdySessions. |
960 static void SetPriorityDependencyDefaultForTesting(bool enable); | 959 static void SetPriorityDependencyDefaultForTesting(bool enable); |
961 | 960 |
962 // Whether Do{Read,Write}Loop() is in the call stack. Useful for | 961 // Whether Do{Read,Write}Loop() is in the call stack. Useful for |
963 // making sure we don't destroy ourselves prematurely in that case. | 962 // making sure we don't destroy ourselves prematurely in that case. |
964 bool in_io_loop_; | 963 bool in_io_loop_; |
965 | 964 |
966 // The key used to identify this session. | 965 // The key used to identify this session. |
967 const SpdySessionKey spdy_session_key_; | 966 const SpdySessionKey spdy_session_key_; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 ReadState read_state_; | 1061 ReadState read_state_; |
1063 WriteState write_state_; | 1062 WriteState write_state_; |
1064 | 1063 |
1065 // If the session is closing (i.e., |availability_state_| is STATE_DRAINING), | 1064 // If the session is closing (i.e., |availability_state_| is STATE_DRAINING), |
1066 // then |error_on_close_| holds the error with which it was closed, which | 1065 // then |error_on_close_| holds the error with which it was closed, which |
1067 // may be OK (upon a polite GOAWAY) or an error < ERR_IO_PENDING otherwise. | 1066 // may be OK (upon a polite GOAWAY) or an error < ERR_IO_PENDING otherwise. |
1068 // Initialized to OK. | 1067 // Initialized to OK. |
1069 Error error_on_close_; | 1068 Error error_on_close_; |
1070 | 1069 |
1071 // Limits | 1070 // Limits |
1072 size_t max_concurrent_streams_; // 0 if no limit | 1071 size_t max_concurrent_streams_; |
1073 size_t max_concurrent_pushed_streams_; | 1072 size_t max_concurrent_pushed_streams_; |
1074 | 1073 |
1075 // Some statistics counters for the session. | 1074 // Some statistics counters for the session. |
1076 int streams_initiated_count_; | 1075 int streams_initiated_count_; |
1077 int streams_pushed_count_; | 1076 int streams_pushed_count_; |
1078 int streams_pushed_and_claimed_count_; | 1077 int streams_pushed_and_claimed_count_; |
1079 int streams_abandoned_count_; | 1078 int streams_abandoned_count_; |
1080 | 1079 |
1081 // |total_bytes_received_| keeps track of all the bytes read by the | 1080 // |total_bytes_received_| keeps track of all the bytes read by the |
1082 // SpdySession. It is used by the |Net.SpdySettingsCwnd...| histograms. | 1081 // SpdySession. It is used by the |Net.SpdySettingsCwnd...| histograms. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 // Used for posting asynchronous IO tasks. We use this even though | 1194 // Used for posting asynchronous IO tasks. We use this even though |
1196 // SpdySession is refcounted because we don't need to keep the SpdySession | 1195 // SpdySession is refcounted because we don't need to keep the SpdySession |
1197 // alive if the last reference is within a RunnableMethod. Just revoke the | 1196 // alive if the last reference is within a RunnableMethod. Just revoke the |
1198 // method. | 1197 // method. |
1199 base::WeakPtrFactory<SpdySession> weak_factory_; | 1198 base::WeakPtrFactory<SpdySession> weak_factory_; |
1200 }; | 1199 }; |
1201 | 1200 |
1202 } // namespace net | 1201 } // namespace net |
1203 | 1202 |
1204 #endif // NET_SPDY_SPDY_SESSION_H_ | 1203 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |