| 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 "chrome/browser/net/connection_tester.h" | 5 #include "chrome/browser/net/connection_tester.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "net/cookies/cookie_monster.h" | 24 #include "net/cookies/cookie_monster.h" |
| 25 #include "net/ftp/ftp_network_layer.h" | 25 #include "net/ftp/ftp_network_layer.h" |
| 26 #include "net/http/http_auth_handler_factory.h" | 26 #include "net/http/http_auth_handler_factory.h" |
| 27 #include "net/http/http_cache.h" | 27 #include "net/http/http_cache.h" |
| 28 #include "net/http/http_network_session.h" | 28 #include "net/http/http_network_session.h" |
| 29 #include "net/http/http_server_properties_impl.h" | 29 #include "net/http/http_server_properties_impl.h" |
| 30 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 30 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
| 31 #include "net/proxy/proxy_config_service_fixed.h" | 31 #include "net/proxy/proxy_config_service_fixed.h" |
| 32 #include "net/proxy/proxy_script_fetcher_impl.h" | 32 #include "net/proxy/proxy_script_fetcher_impl.h" |
| 33 #include "net/proxy/proxy_service.h" | 33 #include "net/proxy/proxy_service.h" |
| 34 #include "net/proxy/proxy_service_v8.h" |
| 34 #include "net/url_request/url_request.h" | 35 #include "net/url_request/url_request.h" |
| 35 #include "net/url_request/url_request_context.h" | 36 #include "net/url_request/url_request_context.h" |
| 36 #include "net/url_request/url_request_context_storage.h" | 37 #include "net/url_request/url_request_context_storage.h" |
| 37 | 38 |
| 38 #if !defined(OS_ANDROID) | 39 #if !defined(OS_ANDROID) |
| 39 #include "chrome/browser/importer/firefox_proxy_settings.h" | 40 #include "chrome/browser/importer/firefox_proxy_settings.h" |
| 40 #endif | 41 #endif |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return net::ERR_NOT_IMPLEMENTED; | 186 return net::ERR_NOT_IMPLEMENTED; |
| 186 } | 187 } |
| 187 | 188 |
| 188 net::DhcpProxyScriptFetcherFactory dhcp_factory; | 189 net::DhcpProxyScriptFetcherFactory dhcp_factory; |
| 189 if (CommandLine::ForCurrentProcess()->HasSwitch( | 190 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 190 switches::kDisableDhcpWpad)) { | 191 switches::kDisableDhcpWpad)) { |
| 191 dhcp_factory.set_enabled(false); | 192 dhcp_factory.set_enabled(false); |
| 192 } | 193 } |
| 193 | 194 |
| 194 experiment_proxy_service->reset( | 195 experiment_proxy_service->reset( |
| 195 net::ProxyService::CreateUsingV8ProxyResolver( | 196 net::CreateProxyServiceUsingV8ProxyResolver( |
| 196 proxy_config_service->release(), | 197 proxy_config_service->release(), |
| 197 0u, | 198 0u, |
| 198 new net::ProxyScriptFetcherImpl(proxy_request_context_), | 199 new net::ProxyScriptFetcherImpl(proxy_request_context_), |
| 199 dhcp_factory.Create(proxy_request_context_), | 200 dhcp_factory.Create(proxy_request_context_), |
| 200 host_resolver(), | 201 host_resolver(), |
| 201 NULL, | 202 NULL, |
| 202 NULL)); | 203 NULL)); |
| 203 | 204 |
| 204 return net::OK; | 205 return net::OK; |
| 205 } | 206 } |
| 206 | 207 |
| 207 // Creates a proxy config service that pulls from the system proxy settings. | 208 // Creates a proxy config service that pulls from the system proxy settings. |
| 208 // On success returns net::OK and fills |config_service| with a new pointer. | 209 // On success returns net::OK and fills |config_service| with a new pointer. |
| 209 // Otherwise returns a network error code. | 210 // Otherwise returns a network error code. |
| 210 int CreateSystemProxyConfigService( | 211 int CreateSystemProxyConfigService( |
| 211 scoped_ptr<net::ProxyConfigService>* config_service) { | 212 scoped_ptr<net::ProxyConfigService>* config_service) { |
| 212 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 213 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 526 |
| 526 // Notify the delegate of completion. | 527 // Notify the delegate of completion. |
| 527 delegate_->OnCompletedConnectionTestExperiment(current, result); | 528 delegate_->OnCompletedConnectionTestExperiment(current, result); |
| 528 | 529 |
| 529 if (remaining_experiments_.empty()) { | 530 if (remaining_experiments_.empty()) { |
| 530 delegate_->OnCompletedConnectionTestSuite(); | 531 delegate_->OnCompletedConnectionTestSuite(); |
| 531 } else { | 532 } else { |
| 532 StartNextExperiment(); | 533 StartNextExperiment(); |
| 533 } | 534 } |
| 534 } | 535 } |
| OLD | NEW |