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" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
14 #include "base/threading/thread_restrictions.h" | 14 #include "base/threading/thread_restrictions.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "net/base/cert_verifier.h" | 18 #include "net/base/cert_verifier.h" |
19 #include "net/base/host_resolver.h" | 19 #include "net/base/host_resolver.h" |
20 #include "net/base/io_buffer.h" | 20 #include "net/base/io_buffer.h" |
21 #include "net/base/net_errors.h" | 21 #include "net/base/net_errors.h" |
22 #include "net/base/net_util.h" | 22 #include "net/base/net_util.h" |
23 #include "net/cookies/cookie_monster.h" | 23 #include "net/cookies/cookie_monster.h" |
| 24 #include "net/ftp/ftp_network_layer.h" |
24 #include "net/http/http_auth_handler_factory.h" | 25 #include "net/http/http_auth_handler_factory.h" |
25 #include "net/http/http_cache.h" | 26 #include "net/http/http_cache.h" |
26 #include "net/http/http_network_session.h" | 27 #include "net/http/http_network_session.h" |
27 #include "net/http/http_server_properties_impl.h" | 28 #include "net/http/http_server_properties_impl.h" |
28 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" | 29 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" |
29 #include "net/proxy/proxy_config_service_fixed.h" | 30 #include "net/proxy/proxy_config_service_fixed.h" |
30 #include "net/proxy/proxy_script_fetcher_impl.h" | 31 #include "net/proxy/proxy_script_fetcher_impl.h" |
31 #include "net/proxy/proxy_service.h" | 32 #include "net/proxy/proxy_service.h" |
32 #include "net/proxy/proxy_service_v8.h" | 33 #include "net/proxy/proxy_service_v8.h" |
33 #include "net/ssl/ssl_config_service_defaults.h" | 34 #include "net/ssl/ssl_config_service_defaults.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 scoped_ptr<net::ProxyService> experiment_proxy_service; | 102 scoped_ptr<net::ProxyService> experiment_proxy_service; |
102 rv = CreateProxyService(experiment.proxy_settings_experiment, | 103 rv = CreateProxyService(experiment.proxy_settings_experiment, |
103 proxy_config_service, &experiment_proxy_service); | 104 proxy_config_service, &experiment_proxy_service); |
104 if (rv != net::OK) | 105 if (rv != net::OK) |
105 return rv; // Failure. | 106 return rv; // Failure. |
106 storage_.set_proxy_service(experiment_proxy_service.release()); | 107 storage_.set_proxy_service(experiment_proxy_service.release()); |
107 | 108 |
108 // The rest of the dependencies are standard, and don't depend on the | 109 // The rest of the dependencies are standard, and don't depend on the |
109 // experiment being run. | 110 // experiment being run. |
110 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); | 111 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); |
| 112 #if !defined(DISABLE_FTP_SUPPORT) |
| 113 storage_.set_ftp_transaction_factory( |
| 114 new net::FtpNetworkLayer(host_resolver())); |
| 115 #endif |
111 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); | 116 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); |
112 storage_.set_http_auth_handler_factory( | 117 storage_.set_http_auth_handler_factory( |
113 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); | 118 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); |
114 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); | 119 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); |
115 | 120 |
116 net::HttpNetworkSession::Params session_params; | 121 net::HttpNetworkSession::Params session_params; |
117 session_params.host_resolver = host_resolver(); | 122 session_params.host_resolver = host_resolver(); |
118 session_params.cert_verifier = cert_verifier(); | 123 session_params.cert_verifier = cert_verifier(); |
119 session_params.proxy_service = proxy_service(); | 124 session_params.proxy_service = proxy_service(); |
120 session_params.ssl_config_service = ssl_config_service(); | 125 session_params.ssl_config_service = ssl_config_service(); |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 538 |
534 // Notify the delegate of completion. | 539 // Notify the delegate of completion. |
535 delegate_->OnCompletedConnectionTestExperiment(current, result); | 540 delegate_->OnCompletedConnectionTestExperiment(current, result); |
536 | 541 |
537 if (remaining_experiments_.empty()) { | 542 if (remaining_experiments_.empty()) { |
538 delegate_->OnCompletedConnectionTestSuite(); | 543 delegate_->OnCompletedConnectionTestSuite(); |
539 } else { | 544 } else { |
540 StartNextExperiment(); | 545 StartNextExperiment(); |
541 } | 546 } |
542 } | 547 } |
OLD | NEW |