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_CHROMIUM_SPDY_SESSION_POOL_H_ | 5 #ifndef NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ |
6 #define NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ | 6 #define NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // proxy. | 172 // proxy. |
173 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session, | 173 void OnNewSpdySessionReady(const base::WeakPtr<SpdySession>& spdy_session, |
174 bool direct, | 174 bool direct, |
175 const SSLConfig& used_ssl_config, | 175 const SSLConfig& used_ssl_config, |
176 const ProxyInfo& used_proxy_info, | 176 const ProxyInfo& used_proxy_info, |
177 bool was_alpn_negotiated, | 177 bool was_alpn_negotiated, |
178 NextProto negotiated_protocol, | 178 NextProto negotiated_protocol, |
179 bool using_spdy, | 179 bool using_spdy, |
180 NetLogSource source_dependency); | 180 NetLogSource source_dependency); |
181 | 181 |
| 182 // Called when a HttpStreamRequest is started with |spdy_session_key|. |
| 183 // Returns true if the request should continue. Returns false if the request |
| 184 // should wait until |callback| is invoked before continuing. |
| 185 bool StartRequest(const SpdySessionKey& spdy_session_key, |
| 186 const base::Closure& callback); |
| 187 |
| 188 // Resumes pending requests with |spdy_session_key|. |
| 189 void ResumePendingRequests(const SpdySessionKey& spdy_session_key); |
| 190 |
182 // Adds |request| to |spdy_session_request_map_| under |spdy_session_key| Key. | 191 // Adds |request| to |spdy_session_request_map_| under |spdy_session_key| Key. |
183 // Sets |spdy_session_key| as |request|'s SpdySessionKey. | 192 // Sets |spdy_session_key| as |request|'s SpdySessionKey. |
184 void AddRequestToSpdySessionRequestMap( | 193 void AddRequestToSpdySessionRequestMap( |
185 const SpdySessionKey& spdy_session_key, | 194 const SpdySessionKey& spdy_session_key, |
186 HttpStreamFactoryImpl::Request* request); | 195 HttpStreamFactoryImpl::Request* request); |
187 | 196 |
188 // Removes |request| from |spdy_session_request_map_|. No-op if |request| does | 197 // Removes |request| from |spdy_session_request_map_|. No-op if |request| does |
189 // not have a SpdySessionKey. | 198 // not have a SpdySessionKey. |
190 void RemoveRequestFromSpdySessionRequestMap( | 199 void RemoveRequestFromSpdySessionRequestMap( |
191 HttpStreamFactoryImpl::Request* request); | 200 HttpStreamFactoryImpl::Request* request); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 bool enable_ping_based_connection_checking_; | 273 bool enable_ping_based_connection_checking_; |
265 | 274 |
266 size_t session_max_recv_window_size_; | 275 size_t session_max_recv_window_size_; |
267 | 276 |
268 // Settings that are sent in the initial SETTINGS frame | 277 // Settings that are sent in the initial SETTINGS frame |
269 // (if |enable_sending_initial_data_| is true), | 278 // (if |enable_sending_initial_data_| is true), |
270 // and also control SpdySession parameters like initial receive window size | 279 // and also control SpdySession parameters like initial receive window size |
271 // and maximum HPACK dynamic table size. | 280 // and maximum HPACK dynamic table size. |
272 const SettingsMap initial_settings_; | 281 const SettingsMap initial_settings_; |
273 | 282 |
| 283 // TODO(xunjieli): Merge these two. |
274 SpdySessionRequestMap spdy_session_request_map_; | 284 SpdySessionRequestMap spdy_session_request_map_; |
| 285 typedef std::map<SpdySessionKey, std::list<base::Closure>> |
| 286 SpdySessionPendingRequestMap; |
| 287 SpdySessionPendingRequestMap spdy_session_pending_request_map_; |
275 | 288 |
276 TimeFunc time_func_; | 289 TimeFunc time_func_; |
277 ServerPushDelegate* push_delegate_; | 290 ServerPushDelegate* push_delegate_; |
278 | 291 |
279 // Determines if a proxy is a trusted SPDY proxy, which is allowed to push | 292 // Determines if a proxy is a trusted SPDY proxy, which is allowed to push |
280 // resources from origins that are different from those of their associated | 293 // resources from origins that are different from those of their associated |
281 // streams. May be nullptr. | 294 // streams. May be nullptr. |
282 ProxyDelegate* proxy_delegate_; | 295 ProxyDelegate* proxy_delegate_; |
283 | 296 |
284 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); | 297 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); |
285 }; | 298 }; |
286 | 299 |
287 } // namespace net | 300 } // namespace net |
288 | 301 |
289 #endif // NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ | 302 #endif // NET_SPDY_CHROMIUM_SPDY_SESSION_POOL_H_ |
OLD | NEW |