OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_POOL_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_POOL_H_ |
6 #define NET_SPDY_SPDY_SESSION_POOL_H_ | 6 #define NET_SPDY_SPDY_SESSION_POOL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <list> | 10 #include <list> |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 scoped_refptr<SpdySession>* spdy_session, | 64 scoped_refptr<SpdySession>* spdy_session, |
65 bool is_secure); | 65 bool is_secure); |
66 | 66 |
67 // TODO(willchan): Consider renaming to HasReusableSession, since perhaps we | 67 // TODO(willchan): Consider renaming to HasReusableSession, since perhaps we |
68 // should be creating a new session. | 68 // should be creating a new session. |
69 bool HasSession(const HostPortPair& host_port_pair)const; | 69 bool HasSession(const HostPortPair& host_port_pair)const; |
70 | 70 |
71 // Close all Spdy Sessions; used for debugging. | 71 // Close all Spdy Sessions; used for debugging. |
72 void CloseAllSessions(); | 72 void CloseAllSessions(); |
73 | 73 |
74 // Removes a SpdySession from the SpdySessionPool. | 74 // Removes a SpdySession from the SpdySessionPool. This should only be called |
| 75 // by SpdySession, because otherwise session->state_ is not set to CLOSED. |
75 void Remove(const scoped_refptr<SpdySession>& session); | 76 void Remove(const scoped_refptr<SpdySession>& session); |
76 | 77 |
77 // NetworkChangeNotifier::Observer methods: | 78 // NetworkChangeNotifier::Observer methods: |
78 | 79 |
79 // We flush all idle sessions and release references to the active ones so | 80 // We flush all idle sessions and release references to the active ones so |
80 // they won't get re-used. The active ones will either complete successfully | 81 // they won't get re-used. The active ones will either complete successfully |
81 // or error out due to the IP address change. | 82 // or error out due to the IP address change. |
82 virtual void OnIPAddressChanged(); | 83 virtual void OnIPAddressChanged(); |
83 | 84 |
84 private: | 85 private: |
(...skipping 23 matching lines...) Expand all Loading... |
108 SpdySessionsMap sessions_; | 109 SpdySessionsMap sessions_; |
109 | 110 |
110 static int g_max_sessions_per_domain; | 111 static int g_max_sessions_per_domain; |
111 | 112 |
112 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 113 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
113 }; | 114 }; |
114 | 115 |
115 } // namespace net | 116 } // namespace net |
116 | 117 |
117 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 118 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |