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/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
16 #include "net/http/http_response_body_drainer.h" | 16 #include "net/http/http_response_body_drainer.h" |
17 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
18 #include "net/http/url_security_manager.h" | 18 #include "net/http/url_security_manager.h" |
19 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
20 #include "net/quic/crypto/quic_random.h" | 20 #include "net/quic/crypto/quic_random.h" |
21 #include "net/quic/quic_clock.h" | 21 #include "net/quic/quic_clock.h" |
22 #include "net/quic/quic_crypto_client_stream_factory.h" | 22 #include "net/quic/quic_crypto_client_stream_factory.h" |
23 #include "net/quic/quic_stream_factory.h" | 23 #include "net/quic/quic_stream_factory.h" |
24 #include "net/socket/client_socket_factory.h" | 24 #include "net/socket/client_socket_factory.h" |
25 #include "net/socket/client_socket_pool_manager_impl.h" | 25 #include "net/socket/client_socket_pool_manager_impl.h" |
26 #include "net/socket/next_proto.h" | 26 #include "net/socket/next_proto.h" |
| 27 #include "net/spdy/hpack_huffman_aggregator.h" |
27 #include "net/spdy/spdy_session_pool.h" | 28 #include "net/spdy/spdy_session_pool.h" |
28 | 29 |
29 namespace { | 30 namespace { |
30 | 31 |
31 net::ClientSocketPoolManager* CreateSocketPoolManager( | 32 net::ClientSocketPoolManager* CreateSocketPoolManager( |
32 net::HttpNetworkSession::SocketPoolType pool_type, | 33 net::HttpNetworkSession::SocketPoolType pool_type, |
33 const net::HttpNetworkSession::Params& params) { | 34 const net::HttpNetworkSession::Params& params) { |
34 // TODO(yutak): Differentiate WebSocket pool manager and allow more | 35 // TODO(yutak): Differentiate WebSocket pool manager and allow more |
35 // simultaneous connections for WebSockets. | 36 // simultaneous connections for WebSockets. |
36 return new net::ClientSocketPoolManagerImpl( | 37 return new net::ClientSocketPoolManagerImpl( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 params.spdy_max_concurrent_streams_limit, | 136 params.spdy_max_concurrent_streams_limit, |
136 params.time_func, | 137 params.time_func, |
137 params.trusted_spdy_proxy), | 138 params.trusted_spdy_proxy), |
138 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), | 139 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), |
139 http_stream_factory_for_websocket_( | 140 http_stream_factory_for_websocket_( |
140 new HttpStreamFactoryImpl(this, true)), | 141 new HttpStreamFactoryImpl(this, true)), |
141 params_(params) { | 142 params_(params) { |
142 DCHECK(proxy_service_); | 143 DCHECK(proxy_service_); |
143 DCHECK(ssl_config_service_.get()); | 144 DCHECK(ssl_config_service_.get()); |
144 CHECK(http_server_properties_); | 145 CHECK(http_server_properties_); |
| 146 |
| 147 if (HpackHuffmanAggregator::UseAggregator()) { |
| 148 huffman_aggregator_.reset(new HpackHuffmanAggregator()); |
| 149 } |
145 } | 150 } |
146 | 151 |
147 HttpNetworkSession::~HttpNetworkSession() { | 152 HttpNetworkSession::~HttpNetworkSession() { |
148 STLDeleteElements(&response_drainers_); | 153 STLDeleteElements(&response_drainers_); |
149 spdy_session_pool_.CloseAllSessions(); | 154 spdy_session_pool_.CloseAllSessions(); |
150 } | 155 } |
151 | 156 |
152 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { | 157 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { |
153 DCHECK(!ContainsKey(response_drainers_, drainer)); | 158 DCHECK(!ContainsKey(response_drainers_, drainer)); |
154 response_drainers_.insert(drainer); | 159 response_drainers_.insert(drainer); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 case WEBSOCKET_SOCKET_POOL: | 241 case WEBSOCKET_SOCKET_POOL: |
237 return websocket_socket_pool_manager_.get(); | 242 return websocket_socket_pool_manager_.get(); |
238 default: | 243 default: |
239 NOTREACHED(); | 244 NOTREACHED(); |
240 break; | 245 break; |
241 } | 246 } |
242 return NULL; | 247 return NULL; |
243 } | 248 } |
244 | 249 |
245 } // namespace net | 250 } // namespace net |
OLD | NEW |