| 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 <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Create a new SPDY session from an existing socket. There must | 72 // Create a new SPDY session from an existing socket. There must |
| 73 // not already be a session for the given key. This pool must have | 73 // not already be a session for the given key. This pool must have |
| 74 // been constructed with a valid |default_protocol| value. | 74 // been constructed with a valid |default_protocol| value. |
| 75 // | 75 // |
| 76 // |is_secure| can be false for testing or when SPDY is configured | 76 // |is_secure| can be false for testing or when SPDY is configured |
| 77 // to work with non-secure sockets. If |is_secure| is true, | 77 // to work with non-secure sockets. If |is_secure| is true, |
| 78 // |certificate_error_code| indicates that the certificate error | 78 // |certificate_error_code| indicates that the certificate error |
| 79 // encountered when connecting the SSL socket, with OK meaning there | 79 // encountered when connecting the SSL socket, with OK meaning there |
| 80 // was no error. | 80 // was no error. |
| 81 // | 81 // |
| 82 // Returns the new SpdySession. Note that the SpdySession begins reading from | 82 // If successful, OK is returned and |available_session| will be |
| 83 // |connection| on a subsequent event loop iteration, so it may be closed | 83 // non-NULL and available. Otherwise, an error is returned and |
| 84 // immediately afterwards if the first read of |connection| fails. | 84 // |available_session| will be NULL. |
| 85 base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( | 85 net::Error CreateAvailableSessionFromSocket( |
| 86 const SpdySessionKey& key, | 86 const SpdySessionKey& key, |
| 87 scoped_ptr<ClientSocketHandle> connection, | 87 scoped_ptr<ClientSocketHandle> connection, |
| 88 const BoundNetLog& net_log, | 88 const BoundNetLog& net_log, |
| 89 int certificate_error_code, | 89 int certificate_error_code, |
| 90 base::WeakPtr<SpdySession>* available_session, |
| 90 bool is_secure); | 91 bool is_secure); |
| 91 | 92 |
| 92 // Find an available session for the given key, or NULL if there isn't one. | 93 // Find an available session for the given key, or NULL if there isn't one. |
| 93 base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key, | 94 base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key, |
| 94 const BoundNetLog& net_log); | 95 const BoundNetLog& net_log); |
| 95 | 96 |
| 96 // Remove all mappings and aliases for the given session, which must | 97 // Remove all mappings and aliases for the given session, which must |
| 97 // still be available. Except for in tests, this must be called by | 98 // still be available. Except for in tests, this must be called by |
| 98 // the given session itself. | 99 // the given session itself. |
| 99 void MakeSessionUnavailable( | 100 void MakeSessionUnavailable( |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // This SPDY proxy is allowed to push resources from origins that are | 225 // This SPDY proxy is allowed to push resources from origins that are |
| 225 // different from those of their associated streams. | 226 // different from those of their associated streams. |
| 226 HostPortPair trusted_spdy_proxy_; | 227 HostPortPair trusted_spdy_proxy_; |
| 227 | 228 |
| 228 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 229 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
| 229 }; | 230 }; |
| 230 | 231 |
| 231 } // namespace net | 232 } // namespace net |
| 232 | 233 |
| 233 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 234 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
| OLD | NEW |