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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // FindAvailableSession() will return it. A session is "unavailable" | 61 // FindAvailableSession() will return it. A session is "unavailable" |
62 // if this pool has a reference to it but it won't be returned by | 62 // if this pool has a reference to it but it won't be returned by |
63 // FindAvailableSession() for any SpdySessionKey; for example, this | 63 // FindAvailableSession() for any SpdySessionKey; for example, this |
64 // can happen when a session receives a GOAWAY frame and is still | 64 // can happen when a session receives a GOAWAY frame and is still |
65 // processing existing streams. | 65 // processing existing streams. |
66 | 66 |
67 // Create a new SPDY session from an existing socket. There must | 67 // Create a new SPDY session from an existing socket. There must |
68 // not already be a session for the given key. | 68 // not already be a session for the given key. |
69 // | 69 // |
70 // |is_secure| can be false for testing or when SPDY is configured | 70 // |is_secure| can be false for testing or when SPDY is configured |
71 // to work with non-secure sockets. If |is_secure| is true, | 71 // to work with non-secure sockets. |
72 // |certificate_error_code| indicates that the certificate error | |
73 // encountered when connecting the SSL socket, with OK meaning there | |
74 // was no error. | |
75 // | 72 // |
76 // Returns the new SpdySession. Note that the SpdySession begins reading from | 73 // Returns the new SpdySession. Note that the SpdySession begins reading from |
77 // |connection| on a subsequent event loop iteration, so it may be closed | 74 // |connection| on a subsequent event loop iteration, so it may be closed |
78 // immediately afterwards if the first read of |connection| fails. | 75 // immediately afterwards if the first read of |connection| fails. |
79 base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( | 76 base::WeakPtr<SpdySession> CreateAvailableSessionFromSocket( |
80 const SpdySessionKey& key, | 77 const SpdySessionKey& key, |
81 std::unique_ptr<ClientSocketHandle> connection, | 78 std::unique_ptr<ClientSocketHandle> connection, |
82 const NetLogWithSource& net_log, | 79 const NetLogWithSource& net_log, |
83 int certificate_error_code, | |
84 bool is_secure); | 80 bool is_secure); |
85 | 81 |
86 // Return an available session for |key| that has an unclaimed push stream for | 82 // 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 | 83 // |url| if such exists and |url| is not empty, or else an available session |
88 // for |key| if such exists, or else nullptr. | 84 // for |key| if such exists, or else nullptr. |
89 base::WeakPtr<SpdySession> FindAvailableSession( | 85 base::WeakPtr<SpdySession> FindAvailableSession( |
90 const SpdySessionKey& key, | 86 const SpdySessionKey& key, |
91 const GURL& url, | 87 const GURL& url, |
92 const NetLogWithSource& net_log); | 88 const NetLogWithSource& net_log); |
93 | 89 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // resources from origins that are different from those of their associated | 224 // resources from origins that are different from those of their associated |
229 // streams. May be nullptr. | 225 // streams. May be nullptr. |
230 ProxyDelegate* proxy_delegate_; | 226 ProxyDelegate* proxy_delegate_; |
231 | 227 |
232 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 228 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
233 }; | 229 }; |
234 | 230 |
235 } // namespace net | 231 } // namespace net |
236 | 232 |
237 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ | 233 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ |
OLD | NEW |