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 #include "net/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/rand_util.h" |
11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 #include "base/values.h" | 14 #include "base/values.h" |
14 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
15 #include "net/http/http_response_body_drainer.h" | 16 #include "net/http/http_response_body_drainer.h" |
16 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
17 #include "net/http/url_security_manager.h" | 18 #include "net/http/url_security_manager.h" |
18 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
| 20 #include "net/quic/quic_clock.h" |
| 21 #include "net/quic/quic_stream_factory.h" |
19 #include "net/socket/client_socket_factory.h" | 22 #include "net/socket/client_socket_factory.h" |
20 #include "net/socket/client_socket_pool_manager_impl.h" | 23 #include "net/socket/client_socket_pool_manager_impl.h" |
21 #include "net/spdy/spdy_session_pool.h" | 24 #include "net/spdy/spdy_session_pool.h" |
22 | 25 |
23 namespace { | 26 namespace { |
24 | 27 |
25 net::ClientSocketPoolManager* CreateSocketPoolManager( | 28 net::ClientSocketPoolManager* CreateSocketPoolManager( |
26 net::HttpNetworkSession::SocketPoolType pool_type, | 29 net::HttpNetworkSession::SocketPoolType pool_type, |
27 const net::HttpNetworkSession::Params& params) { | 30 const net::HttpNetworkSession::Params& params) { |
28 // TODO(yutak): Differentiate WebSocket pool manager and allow more | 31 // TODO(yutak): Differentiate WebSocket pool manager and allow more |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 proxy_service_(params.proxy_service), | 79 proxy_service_(params.proxy_service), |
77 ssl_config_service_(params.ssl_config_service), | 80 ssl_config_service_(params.ssl_config_service), |
78 normal_socket_pool_manager_( | 81 normal_socket_pool_manager_( |
79 CreateSocketPoolManager(NORMAL_SOCKET_POOL, params)), | 82 CreateSocketPoolManager(NORMAL_SOCKET_POOL, params)), |
80 websocket_socket_pool_manager_( | 83 websocket_socket_pool_manager_( |
81 CreateSocketPoolManager(WEBSOCKET_SOCKET_POOL, params)), | 84 CreateSocketPoolManager(WEBSOCKET_SOCKET_POOL, params)), |
82 spdy_session_pool_(params.host_resolver, | 85 spdy_session_pool_(params.host_resolver, |
83 params.ssl_config_service, | 86 params.ssl_config_service, |
84 params.http_server_properties, | 87 params.http_server_properties, |
85 params.trusted_spdy_proxy), | 88 params.trusted_spdy_proxy), |
| 89 quic_stream_factory_(params.host_resolver, |
| 90 net::ClientSocketFactory::GetDefaultFactory(), |
| 91 base::Bind(&base::RandUint64), |
| 92 new QuicClock()), |
86 ALLOW_THIS_IN_INITIALIZER_LIST(http_stream_factory_( | 93 ALLOW_THIS_IN_INITIALIZER_LIST(http_stream_factory_( |
87 new HttpStreamFactoryImpl(this))), | 94 new HttpStreamFactoryImpl(this))), |
88 params_(params) { | 95 params_(params) { |
89 DCHECK(proxy_service_); | 96 DCHECK(proxy_service_); |
90 DCHECK(ssl_config_service_); | 97 DCHECK(ssl_config_service_); |
91 CHECK(http_server_properties_); | 98 CHECK(http_server_properties_); |
92 } | 99 } |
93 | 100 |
94 HttpNetworkSession::~HttpNetworkSession() { | 101 HttpNetworkSession::~HttpNetworkSession() { |
95 STLDeleteElements(&response_drainers_); | 102 STLDeleteElements(&response_drainers_); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 case WEBSOCKET_SOCKET_POOL: | 173 case WEBSOCKET_SOCKET_POOL: |
167 return websocket_socket_pool_manager_.get(); | 174 return websocket_socket_pool_manager_.get(); |
168 default: | 175 default: |
169 NOTREACHED(); | 176 NOTREACHED(); |
170 break; | 177 break; |
171 } | 178 } |
172 return NULL; | 179 return NULL; |
173 } | 180 } |
174 | 181 |
175 } // namespace net | 182 } // namespace net |
OLD | NEW |