| 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/socket/client_socket_pool_manager.h" | 5 #include "net/socket/client_socket_pool_manager.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 scoped_refptr<HttpProxySocketParams> http_proxy_params; | 86 scoped_refptr<HttpProxySocketParams> http_proxy_params; |
| 87 scoped_refptr<SOCKSSocketParams> socks_params; | 87 scoped_refptr<SOCKSSocketParams> socks_params; |
| 88 scoped_ptr<HostPortPair> proxy_host_port; | 88 scoped_ptr<HostPortPair> proxy_host_port; |
| 89 | 89 |
| 90 bool using_ssl = request_url.SchemeIs("https") || force_spdy_over_ssl; | 90 bool using_ssl = request_url.SchemeIs("https") || force_spdy_over_ssl; |
| 91 | 91 |
| 92 HostPortPair origin_host_port = | 92 HostPortPair origin_host_port = |
| 93 HostPortPair(request_url.HostNoBrackets(), | 93 HostPortPair(request_url.HostNoBrackets(), |
| 94 request_url.EffectiveIntPort()); | 94 request_url.EffectiveIntPort()); |
| 95 | 95 |
| 96 if (!using_ssl && HttpStreamFactory::testing_fixed_http_port() != 0) { | 96 if (!using_ssl && session->params().testing_fixed_http_port != 0) { |
| 97 origin_host_port.set_port(HttpStreamFactory::testing_fixed_http_port()); | 97 origin_host_port.set_port(session->params().testing_fixed_http_port); |
| 98 } else if (using_ssl && HttpStreamFactory::testing_fixed_https_port() != 0) { | 98 } else if (using_ssl && session->params().testing_fixed_https_port != 0) { |
| 99 origin_host_port.set_port(HttpStreamFactory::testing_fixed_https_port()); | 99 origin_host_port.set_port(session->params().testing_fixed_https_port); |
| 100 } | 100 } |
| 101 | 101 |
| 102 bool disable_resolver_cache = | 102 bool disable_resolver_cache = |
| 103 request_load_flags & LOAD_BYPASS_CACHE || | 103 request_load_flags & LOAD_BYPASS_CACHE || |
| 104 request_load_flags & LOAD_VALIDATE_CACHE || | 104 request_load_flags & LOAD_VALIDATE_CACHE || |
| 105 request_load_flags & LOAD_DISABLE_CACHE; | 105 request_load_flags & LOAD_DISABLE_CACHE; |
| 106 | 106 |
| 107 int load_flags = request_load_flags; | 107 int load_flags = request_load_flags; |
| 108 if (HttpStreamFactory::ignore_certificate_errors()) | 108 if (session->params().ignore_certificate_errors) |
| 109 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; | 109 load_flags |= LOAD_IGNORE_ALL_CERT_ERRORS; |
| 110 | 110 |
| 111 // Build the string used to uniquely identify connections of this type. | 111 // Build the string used to uniquely identify connections of this type. |
| 112 // Determine the host and port to connect to. | 112 // Determine the host and port to connect to. |
| 113 std::string connection_group = origin_host_port.ToString(); | 113 std::string connection_group = origin_host_port.ToString(); |
| 114 DCHECK(!connection_group.empty()); | 114 DCHECK(!connection_group.empty()); |
| 115 if (using_ssl) { | 115 if (using_ssl) { |
| 116 // All connections in a group should use the same SSLConfig settings. | 116 // All connections in a group should use the same SSLConfig settings. |
| 117 // Encode version_max in the connection group's name, unless it's the | 117 // Encode version_max in the connection group's name, unless it's the |
| 118 // default version_max. (We want the common case to use the shortest | 118 // default version_max. (We want the common case to use the shortest |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 int num_preconnect_streams) { | 419 int num_preconnect_streams) { |
| 420 return InitSocketPoolHelper( | 420 return InitSocketPoolHelper( |
| 421 request_url, request_extra_headers, request_load_flags, request_priority, | 421 request_url, request_extra_headers, request_load_flags, request_priority, |
| 422 session, proxy_info, force_spdy_over_ssl, want_spdy_over_npn, | 422 session, proxy_info, force_spdy_over_ssl, want_spdy_over_npn, |
| 423 ssl_config_for_origin, ssl_config_for_proxy, false, net_log, | 423 ssl_config_for_origin, ssl_config_for_proxy, false, net_log, |
| 424 num_preconnect_streams, NULL, OnHostResolutionCallback(), | 424 num_preconnect_streams, NULL, OnHostResolutionCallback(), |
| 425 CompletionCallback()); | 425 CompletionCallback()); |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace net | 428 } // namespace net |
| OLD | NEW |