| 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/rand_util.h" |
| 12 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "base/values.h" | 15 #include "base/values.h" |
| 15 #include "net/http/http_auth_handler_factory.h" | 16 #include "net/http/http_auth_handler_factory.h" |
| 16 #include "net/http/http_response_body_drainer.h" | 17 #include "net/http/http_response_body_drainer.h" |
| 17 #include "net/http/http_stream_factory_impl.h" | 18 #include "net/http/http_stream_factory_impl.h" |
| 18 #include "net/http/url_security_manager.h" | 19 #include "net/http/url_security_manager.h" |
| 19 #include "net/proxy/proxy_service.h" | 20 #include "net/proxy/proxy_service.h" |
| 21 #include "net/quic/quic_clock.h" |
| 22 #include "net/quic/quic_stream_factory.h" |
| 20 #include "net/socket/client_socket_factory.h" | 23 #include "net/socket/client_socket_factory.h" |
| 21 #include "net/socket/client_socket_pool_manager_impl.h" | 24 #include "net/socket/client_socket_pool_manager_impl.h" |
| 22 #include "net/socket/next_proto.h" | 25 #include "net/socket/next_proto.h" |
| 23 #include "net/spdy/spdy_session_pool.h" | 26 #include "net/spdy/spdy_session_pool.h" |
| 24 | 27 |
| 25 namespace { | 28 namespace { |
| 26 | 29 |
| 27 net::ClientSocketPoolManager* CreateSocketPoolManager( | 30 net::ClientSocketPoolManager* CreateSocketPoolManager( |
| 28 net::HttpNetworkSession::SocketPoolType pool_type, | 31 net::HttpNetworkSession::SocketPoolType pool_type, |
| 29 const net::HttpNetworkSession::Params& params) { | 32 const net::HttpNetworkSession::Params& params) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 max_spdy_sessions_per_domain(0), | 72 max_spdy_sessions_per_domain(0), |
| 70 force_spdy_single_domain(false), | 73 force_spdy_single_domain(false), |
| 71 enable_spdy_ip_pooling(true), | 74 enable_spdy_ip_pooling(true), |
| 72 enable_spdy_credential_frames(false), | 75 enable_spdy_credential_frames(false), |
| 73 enable_spdy_compression(true), | 76 enable_spdy_compression(true), |
| 74 enable_spdy_ping_based_connection_checking(true), | 77 enable_spdy_ping_based_connection_checking(true), |
| 75 spdy_default_protocol(kProtoUnknown), | 78 spdy_default_protocol(kProtoUnknown), |
| 76 spdy_initial_recv_window_size(0), | 79 spdy_initial_recv_window_size(0), |
| 77 spdy_initial_max_concurrent_streams(0), | 80 spdy_initial_max_concurrent_streams(0), |
| 78 spdy_max_concurrent_streams_limit(0), | 81 spdy_max_concurrent_streams_limit(0), |
| 79 time_func(&base::TimeTicks::Now) { | 82 time_func(&base::TimeTicks::Now), |
| 83 origin_port_to_force_quic_on(0) { |
| 80 } | 84 } |
| 81 | 85 |
| 82 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 86 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
| 83 HttpNetworkSession::HttpNetworkSession(const Params& params) | 87 HttpNetworkSession::HttpNetworkSession(const Params& params) |
| 84 : net_log_(params.net_log), | 88 : net_log_(params.net_log), |
| 85 network_delegate_(params.network_delegate), | 89 network_delegate_(params.network_delegate), |
| 86 http_server_properties_(params.http_server_properties), | 90 http_server_properties_(params.http_server_properties), |
| 87 cert_verifier_(params.cert_verifier), | 91 cert_verifier_(params.cert_verifier), |
| 88 http_auth_handler_factory_(params.http_auth_handler_factory), | 92 http_auth_handler_factory_(params.http_auth_handler_factory), |
| 89 force_http_pipelining_(params.force_http_pipelining), | 93 force_http_pipelining_(params.force_http_pipelining), |
| 90 proxy_service_(params.proxy_service), | 94 proxy_service_(params.proxy_service), |
| 91 ssl_config_service_(params.ssl_config_service), | 95 ssl_config_service_(params.ssl_config_service), |
| 92 normal_socket_pool_manager_( | 96 normal_socket_pool_manager_( |
| 93 CreateSocketPoolManager(NORMAL_SOCKET_POOL, params)), | 97 CreateSocketPoolManager(NORMAL_SOCKET_POOL, params)), |
| 94 websocket_socket_pool_manager_( | 98 websocket_socket_pool_manager_( |
| 95 CreateSocketPoolManager(WEBSOCKET_SOCKET_POOL, params)), | 99 CreateSocketPoolManager(WEBSOCKET_SOCKET_POOL, params)), |
| 100 quic_stream_factory_(params.host_resolver, |
| 101 net::ClientSocketFactory::GetDefaultFactory(), |
| 102 base::Bind(&base::RandUint64), |
| 103 new QuicClock()), |
| 96 spdy_session_pool_(params.host_resolver, | 104 spdy_session_pool_(params.host_resolver, |
| 97 params.ssl_config_service, | 105 params.ssl_config_service, |
| 98 params.http_server_properties, | 106 params.http_server_properties, |
| 99 params.max_spdy_sessions_per_domain, | 107 params.max_spdy_sessions_per_domain, |
| 100 params.force_spdy_single_domain, | 108 params.force_spdy_single_domain, |
| 101 params.enable_spdy_ip_pooling, | 109 params.enable_spdy_ip_pooling, |
| 102 params.enable_spdy_credential_frames, | 110 params.enable_spdy_credential_frames, |
| 103 params.enable_spdy_compression, | 111 params.enable_spdy_compression, |
| 104 params.enable_spdy_ping_based_connection_checking, | 112 params.enable_spdy_ping_based_connection_checking, |
| 105 params.spdy_default_protocol, | 113 params.spdy_default_protocol, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 case WEBSOCKET_SOCKET_POOL: | 199 case WEBSOCKET_SOCKET_POOL: |
| 192 return websocket_socket_pool_manager_.get(); | 200 return websocket_socket_pool_manager_.get(); |
| 193 default: | 201 default: |
| 194 NOTREACHED(); | 202 NOTREACHED(); |
| 195 break; | 203 break; |
| 196 } | 204 } |
| 197 return NULL; | 205 return NULL; |
| 198 } | 206 } |
| 199 | 207 |
| 200 } // namespace net | 208 } // namespace net |
| OLD | NEW |