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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <set> | 12 #include <set> |
13 #include <string> | |
14 #include <vector> | 13 #include <vector> |
15 | 14 |
16 #include "base/macros.h" | 15 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
19 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
20 #include "net/base/ip_endpoint.h" | 19 #include "net/base/ip_endpoint.h" |
21 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
22 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
23 #include "net/base/network_change_notifier.h" | 22 #include "net/base/network_change_notifier.h" |
24 #include "net/cert/cert_database.h" | 23 #include "net/cert/cert_database.h" |
25 #include "net/proxy/proxy_config.h" | 24 #include "net/proxy/proxy_config.h" |
26 #include "net/proxy/proxy_server.h" | 25 #include "net/proxy/proxy_server.h" |
| 26 #include "net/spdy/platform/api/spdy_string.h" |
27 #include "net/spdy/server_push_delegate.h" | 27 #include "net/spdy/server_push_delegate.h" |
28 #include "net/spdy/spdy_protocol.h" | 28 #include "net/spdy/spdy_protocol.h" |
29 #include "net/spdy/spdy_session_key.h" | 29 #include "net/spdy/spdy_session_key.h" |
30 #include "net/ssl/ssl_config_service.h" | 30 #include "net/ssl/ssl_config_service.h" |
31 | 31 |
32 namespace base { | 32 namespace base { |
33 namespace trace_event { | 33 namespace trace_event { |
34 class ProcessMemoryDump; | 34 class ProcessMemoryDump; |
35 } | 35 } |
36 } | 36 } |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // We perform the same flushing as described above when SSL settings change. | 157 // We perform the same flushing as described above when SSL settings change. |
158 void OnSSLConfigChanged() override; | 158 void OnSSLConfigChanged() override; |
159 | 159 |
160 // CertDatabase::Observer methods: | 160 // CertDatabase::Observer methods: |
161 | 161 |
162 // We perform the same flushing as described above when certificate database | 162 // We perform the same flushing as described above when certificate database |
163 // is changed. | 163 // is changed. |
164 void OnCertDBChanged() override; | 164 void OnCertDBChanged() override; |
165 | 165 |
166 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, | 166 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, |
167 const std::string& parent_dump_absolute_name) const; | 167 const SpdyString& parent_dump_absolute_name) const; |
168 | 168 |
169 private: | 169 private: |
170 friend class SpdySessionPoolPeer; // For testing. | 170 friend class SpdySessionPoolPeer; // For testing. |
171 | 171 |
172 typedef std::set<SpdySession*> SessionSet; | 172 typedef std::set<SpdySession*> SessionSet; |
173 typedef std::vector<base::WeakPtr<SpdySession> > WeakSessionList; | 173 typedef std::vector<base::WeakPtr<SpdySession> > WeakSessionList; |
174 typedef std::map<SpdySessionKey, base::WeakPtr<SpdySession> > | 174 typedef std::map<SpdySessionKey, base::WeakPtr<SpdySession> > |
175 AvailableSessionMap; | 175 AvailableSessionMap; |
176 typedef std::map<IPEndPoint, SpdySessionKey> AliasMap; | 176 typedef std::map<IPEndPoint, SpdySessionKey> AliasMap; |
177 typedef std::map<GURL, WeakSessionList> UnclaimedPushedStreamMap; | 177 typedef std::map<GURL, WeakSessionList> UnclaimedPushedStreamMap; |
(...skipping 17 matching lines...) Expand all Loading... |
195 // Remove all aliases for |key| from the aliases table. | 195 // Remove all aliases for |key| from the aliases table. |
196 void RemoveAliases(const SpdySessionKey& key); | 196 void RemoveAliases(const SpdySessionKey& key); |
197 | 197 |
198 // Get a copy of the current sessions as a list of WeakPtrs. Used by | 198 // Get a copy of the current sessions as a list of WeakPtrs. Used by |
199 // CloseCurrentSessionsHelper() below. | 199 // CloseCurrentSessionsHelper() below. |
200 WeakSessionList GetCurrentSessions() const; | 200 WeakSessionList GetCurrentSessions() const; |
201 | 201 |
202 // Close only the currently existing SpdySessions with |error|. Let | 202 // Close only the currently existing SpdySessions with |error|. Let |
203 // any new ones created while this method is running continue to | 203 // any new ones created while this method is running continue to |
204 // live. If |idle_only| is true only idle sessions are closed. | 204 // live. If |idle_only| is true only idle sessions are closed. |
205 void CloseCurrentSessionsHelper( | 205 void CloseCurrentSessionsHelper(Error error, |
206 Error error, | 206 const SpdyString& description, |
207 const std::string& description, | 207 bool idle_only); |
208 bool idle_only); | |
209 | 208 |
210 HttpServerProperties* http_server_properties_; | 209 HttpServerProperties* http_server_properties_; |
211 | 210 |
212 TransportSecurityState* transport_security_state_; | 211 TransportSecurityState* transport_security_state_; |
213 | 212 |
214 // The set of all sessions. This is a superset of the sessions in | 213 // The set of all sessions. This is a superset of the sessions in |
215 // |available_sessions_|. | 214 // |available_sessions_|. |
216 // | 215 // |
217 // |sessions_| owns all its SpdySession objects. | 216 // |sessions_| owns all its SpdySession objects. |
218 SessionSet sessions_; | 217 SessionSet sessions_; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // resources from origins that are different from those of their associated | 252 // resources from origins that are different from those of their associated |
254 // streams. May be nullptr. | 253 // streams. May be nullptr. |
255 ProxyDelegate* proxy_delegate_; | 254 ProxyDelegate* proxy_delegate_; |
256 | 255 |
257 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 256 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
258 }; | 257 }; |
259 | 258 |
260 } // namespace net | 259 } // namespace net |
261 | 260 |
262 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 261 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |