| 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> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "net/base/network_change_notifier.h" | 22 #include "net/base/network_change_notifier.h" |
| 23 #include "net/cert/cert_database.h" | 23 #include "net/cert/cert_database.h" |
| 24 #include "net/proxy/proxy_config.h" | 24 #include "net/proxy/proxy_config.h" |
| 25 #include "net/proxy/proxy_server.h" | 25 #include "net/proxy/proxy_server.h" |
| 26 #include "net/spdy/spdy_session_key.h" | 26 #include "net/spdy/spdy_session_key.h" |
| 27 #include "net/ssl/ssl_config_service.h" | 27 #include "net/ssl/ssl_config_service.h" |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 | 30 |
| 31 class AddressList; | 31 class AddressList; |
| 32 class BoundNetLog; | 32 class NetLogWithSource; |
| 33 class ClientSocketHandle; | 33 class ClientSocketHandle; |
| 34 class HostResolver; | 34 class HostResolver; |
| 35 class HttpServerProperties; | 35 class HttpServerProperties; |
| 36 class ProxyDelegate; | 36 class ProxyDelegate; |
| 37 class SpdySession; | 37 class SpdySession; |
| 38 class TransportSecurityState; | 38 class TransportSecurityState; |
| 39 | 39 |
| 40 // This is a very simple pool for open SpdySessions. | 40 // This is a very simple pool for open SpdySessions. |
| 41 class NET_EXPORT SpdySessionPool | 41 class NET_EXPORT SpdySessionPool |
| 42 : public NetworkChangeNotifier::IPAddressObserver, | 42 : public NetworkChangeNotifier::IPAddressObserver, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 72 // |certificate_error_code| indicates that the certificate error | 72 // |certificate_error_code| indicates that the certificate error |
| 73 // encountered when connecting the SSL socket, with OK meaning there | 73 // encountered when connecting the SSL socket, with OK meaning there |
| 74 // was no error. | 74 // was no error. |
| 75 // | 75 // |
| 76 // Returns the new SpdySession. Note that the SpdySession begins reading from | 76 // Returns the new SpdySession. Note that the SpdySession begins reading from |
| 77 // |connection| on a subsequent event loop iteration, so it may be closed | 77 // |connection| on a subsequent event loop iteration, so it may be closed |
| 78 // immediately afterwards if the first read of |connection| fails. | 78 // immediately afterwards if the first read of |connection| fails. |
| 79 base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( | 79 base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( |
| 80 const SpdySessionKey& key, | 80 const SpdySessionKey& key, |
| 81 std::unique_ptr<ClientSocketHandle> connection, | 81 std::unique_ptr<ClientSocketHandle> connection, |
| 82 const BoundNetLog& net_log, | 82 const NetLogWithSource& net_log, |
| 83 int certificate_error_code, | 83 int certificate_error_code, |
| 84 bool is_secure); | 84 bool is_secure); |
| 85 | 85 |
| 86 // Return an available session for |key| that has an unclaimed push stream for | 86 // Return an available session for |key| that has an unclaimed push stream for |
| 87 // |url| if such exists and |url| is not empty, or else an available session | 87 // |url| if such exists and |url| is not empty, or else an available session |
| 88 // for |key| if such exists, or else nullptr. | 88 // for |key| if such exists, or else nullptr. |
| 89 base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key, | 89 base::WeakPtr<SpdySession> FindAvailableSession( |
| 90 const GURL& url, | 90 const SpdySessionKey& key, |
| 91 const BoundNetLog& net_log); | 91 const GURL& url, |
| 92 const NetLogWithSource& net_log); |
| 92 | 93 |
| 93 // Remove all mappings and aliases for the given session, which must | 94 // Remove all mappings and aliases for the given session, which must |
| 94 // still be available. Except for in tests, this must be called by | 95 // still be available. Except for in tests, this must be called by |
| 95 // the given session itself. | 96 // the given session itself. |
| 96 void MakeSessionUnavailable( | 97 void MakeSessionUnavailable( |
| 97 const base::WeakPtr<SpdySession>& available_session); | 98 const base::WeakPtr<SpdySession>& available_session); |
| 98 | 99 |
| 99 // Removes an unavailable session from the pool. Except for in | 100 // Removes an unavailable session from the pool. Except for in |
| 100 // tests, this must be called by the given session itself. | 101 // tests, this must be called by the given session itself. |
| 101 void RemoveUnavailableSession( | 102 void RemoveUnavailableSession( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // resources from origins that are different from those of their associated | 229 // resources from origins that are different from those of their associated |
| 229 // streams. May be nullptr. | 230 // streams. May be nullptr. |
| 230 ProxyDelegate* proxy_delegate_; | 231 ProxyDelegate* proxy_delegate_; |
| 231 | 232 |
| 232 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 233 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
| 233 }; | 234 }; |
| 234 | 235 |
| 235 } // namespace net | 236 } // namespace net |
| 236 | 237 |
| 237 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 238 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
| OLD | NEW |