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_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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <list> | 9 #include <list> |
10 #include <string> | 10 #include <string> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // TODO(willchan): Consider renaming to HasReusableSession, since perhaps we | 97 // TODO(willchan): Consider renaming to HasReusableSession, since perhaps we |
98 // should be creating a new session. WARNING: Because of IP connection pooling | 98 // should be creating a new session. WARNING: Because of IP connection pooling |
99 // using the HostCache, if HasSession() returns true at one point, it does not | 99 // using the HostCache, if HasSession() returns true at one point, it does not |
100 // imply the SpdySessionPool will still have a matching session in the near | 100 // imply the SpdySessionPool will still have a matching session in the near |
101 // future, since the HostCache's entry may have expired. | 101 // future, since the HostCache's entry may have expired. |
102 bool HasSession(const HostPortProxyPair& host_port_proxy_pair) const; | 102 bool HasSession(const HostPortProxyPair& host_port_proxy_pair) const; |
103 | 103 |
104 // Close all SpdySessions, including any new ones created in the process of | 104 // Close all SpdySessions, including any new ones created in the process of |
105 // closing the current ones. | 105 // closing the current ones. |
106 void CloseAllSessions(); | 106 void CloseAllSessions(); |
107 // Close only the currently existing SpdySessions. Let any new ones created | 107 // Close only the currently existing SpdySessions with |error|. |
108 // continue to live. | 108 // Let any new ones created continue to live. |
109 void CloseCurrentSessions(); | 109 void CloseCurrentSessions(net::Error error); |
110 // Close only the idle SpdySessions. | 110 // Close only the idle SpdySessions. |
111 void CloseIdleSessions(); | 111 void CloseIdleSessions(); |
112 | 112 |
113 // Removes a SpdySession from the SpdySessionPool. This should only be called | 113 // Removes a SpdySession from the SpdySessionPool. This should only be called |
114 // by SpdySession, because otherwise session->state_ is not set to CLOSED. | 114 // by SpdySession, because otherwise session->state_ is not set to CLOSED. |
115 void Remove(const scoped_refptr<SpdySession>& session); | 115 void Remove(const scoped_refptr<SpdySession>& session); |
116 | 116 |
117 // Creates a Value summary of the state of the spdy session pool. The caller | 117 // Creates a Value summary of the state of the spdy session pool. The caller |
118 // responsible for deleting the returned value. | 118 // responsible for deleting the returned value. |
119 base::Value* SpdySessionPoolInfoToValue() const; | 119 base::Value* SpdySessionPoolInfoToValue() const; |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // This SPDY proxy is allowed to push resources from origins that are | 221 // This SPDY proxy is allowed to push resources from origins that are |
222 // different from those of their associated streams. | 222 // different from those of their associated streams. |
223 HostPortPair trusted_spdy_proxy_; | 223 HostPortPair trusted_spdy_proxy_; |
224 | 224 |
225 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 225 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
226 }; | 226 }; |
227 | 227 |
228 } // namespace net | 228 } // namespace net |
229 | 229 |
230 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 230 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |