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 // If successful, OK is returned and |available_session| will be | 82 // Returns the new SpdySession. Note that the SpdySession begins reading from |
83 // non-NULL and available. Otherwise, an error is returned and | 83 // |connection| on a subsequent event loop iteration, so it may be closed |
84 // |available_session| will be NULL. | 84 // immediately afterwards if the first read of |connection| fails. |
85 net::Error CreateAvailableSessionFromSocket( | 85 base::WeakPtr<SpdySession> 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, | |
91 bool is_secure); | 90 bool is_secure); |
92 | 91 |
93 // Find an available session for the given key, or NULL if there isn't one. | 92 // Find an available session for the given key, or NULL if there isn't one. |
94 base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key, | 93 base::WeakPtr<SpdySession> FindAvailableSession(const SpdySessionKey& key, |
95 const BoundNetLog& net_log); | 94 const BoundNetLog& net_log); |
96 | 95 |
97 // Remove all mappings and aliases for the given session, which must | 96 // Remove all mappings and aliases for the given session, which must |
98 // still be available. Except for in tests, this must be called by | 97 // still be available. Except for in tests, this must be called by |
99 // the given session itself. | 98 // the given session itself. |
100 void MakeSessionUnavailable( | 99 void MakeSessionUnavailable( |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // This SPDY proxy is allowed to push resources from origins that are | 224 // This SPDY proxy is allowed to push resources from origins that are |
226 // different from those of their associated streams. | 225 // different from those of their associated streams. |
227 HostPortPair trusted_spdy_proxy_; | 226 HostPortPair trusted_spdy_proxy_; |
228 | 227 |
229 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 228 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
230 }; | 229 }; |
231 | 230 |
232 } // namespace net | 231 } // namespace net |
233 | 232 |
234 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 233 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |