| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/net/preconnect.h" | 5 #include "chrome/browser/net/preconnect.h" |
| 6 | 6 |
| 7 #include "base/histogram.h" | 7 #include "base/histogram.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 group_name = StringPrintf("ssl/%s", group_name.c_str()); | 131 group_name = StringPrintf("ssl/%s", group_name.c_str()); |
| 132 | 132 |
| 133 net::SSLConfig ssl_config; | 133 net::SSLConfig ssl_config; |
| 134 session->ssl_config_service()->GetSSLConfig(&ssl_config); | 134 session->ssl_config_service()->GetSSLConfig(&ssl_config); |
| 135 // All preconnects should be for main pages. | 135 // All preconnects should be for main pages. |
| 136 ssl_config.verify_ev_cert = true; | 136 ssl_config.verify_ev_cert = true; |
| 137 | 137 |
| 138 scoped_refptr<net::SSLSocketParams> ssl_params = | 138 scoped_refptr<net::SSLSocketParams> ssl_params = |
| 139 new net::SSLSocketParams(tcp_params, NULL, NULL, | 139 new net::SSLSocketParams(tcp_params, NULL, NULL, |
| 140 net::ProxyServer::SCHEME_DIRECT, | 140 net::ProxyServer::SCHEME_DIRECT, |
| 141 url.HostNoBrackets(), ssl_config, | 141 endpoint, ssl_config, |
| 142 0, false, false); | 142 0, false, false); |
| 143 | 143 |
| 144 const scoped_refptr<net::SSLClientSocketPool>& pool = | 144 const scoped_refptr<net::SSLClientSocketPool>& pool = |
| 145 session->ssl_socket_pool(); | 145 session->ssl_socket_pool(); |
| 146 | 146 |
| 147 rv = handle_.Init(group_name, ssl_params, priority, this, pool, | 147 rv = handle_.Init(group_name, ssl_params, priority, this, pool, |
| 148 net::BoundNetLog()); | 148 net::BoundNetLog()); |
| 149 } else { | 149 } else { |
| 150 const scoped_refptr<net::TCPClientSocketPool>& pool = | 150 const scoped_refptr<net::TCPClientSocketPool>& pool = |
| 151 session->tcp_socket_pool(); | 151 session->tcp_socket_pool(); |
| 152 rv = handle_.Init(group_name, tcp_params, priority, this, pool, | 152 rv = handle_.Init(group_name, tcp_params, priority, this, pool, |
| 153 net::BoundNetLog()); | 153 net::BoundNetLog()); |
| 154 } | 154 } |
| 155 | 155 |
| 156 if (rv != net::ERR_IO_PENDING) | 156 if (rv != net::ERR_IO_PENDING) |
| 157 Release(); // There will be no callback. | 157 Release(); // There will be no callback. |
| 158 } | 158 } |
| 159 | 159 |
| 160 void Preconnect::RunWithParams(const Tuple1<int>& params) { | 160 void Preconnect::RunWithParams(const Tuple1<int>& params) { |
| 161 if (params.a < 0 && handle_.socket()) | 161 if (params.a < 0 && handle_.socket()) |
| 162 handle_.socket()->Disconnect(); | 162 handle_.socket()->Disconnect(); |
| 163 Release(); | 163 Release(); |
| 164 } | 164 } |
| 165 } // chrome_browser_net | 165 } // chrome_browser_net |
| OLD | NEW |