Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/net/connection_tester.cc

Issue 16501002: Give more request types a TransportSecurityState. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enforce CalledOnValidThread in all non-static methods. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
15 #include "base/threading/thread_restrictions.h" 15 #include "base/threading/thread_restrictions.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/io_buffer.h" 18 #include "net/base/io_buffer.h"
19 #include "net/base/net_errors.h" 19 #include "net/base/net_errors.h"
20 #include "net/base/net_util.h" 20 #include "net/base/net_util.h"
21 #include "net/cert/cert_verifier.h" 21 #include "net/cert/cert_verifier.h"
22 #include "net/cookies/cookie_monster.h" 22 #include "net/cookies/cookie_monster.h"
23 #include "net/dns/host_resolver.h" 23 #include "net/dns/host_resolver.h"
24 #include "net/http/http_auth_handler_factory.h" 24 #include "net/http/http_auth_handler_factory.h"
25 #include "net/http/http_cache.h" 25 #include "net/http/http_cache.h"
26 #include "net/http/http_network_session.h" 26 #include "net/http/http_network_session.h"
27 #include "net/http/http_server_properties_impl.h" 27 #include "net/http/http_server_properties_impl.h"
28 #include "net/http/transport_security_state.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"
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
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 storage_.set_transport_security_state(new net::TransportSecurityState);
111 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); 113 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
112 storage_.set_http_auth_handler_factory( 114 storage_.set_http_auth_handler_factory(
113 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); 115 net::HttpAuthHandlerFactory::CreateDefault(host_resolver()));
114 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); 116 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl);
115 117
116 net::HttpNetworkSession::Params session_params; 118 net::HttpNetworkSession::Params session_params;
117 session_params.host_resolver = host_resolver(); 119 session_params.host_resolver = host_resolver();
118 session_params.cert_verifier = cert_verifier(); 120 session_params.cert_verifier = cert_verifier();
121 session_params.transport_security_state = transport_security_state();
119 session_params.proxy_service = proxy_service(); 122 session_params.proxy_service = proxy_service();
120 session_params.ssl_config_service = ssl_config_service(); 123 session_params.ssl_config_service = ssl_config_service();
121 session_params.http_auth_handler_factory = http_auth_handler_factory(); 124 session_params.http_auth_handler_factory = http_auth_handler_factory();
122 session_params.http_server_properties = http_server_properties(); 125 session_params.http_server_properties = http_server_properties();
123 session_params.net_log = net_log; 126 session_params.net_log = net_log;
124 scoped_refptr<net::HttpNetworkSession> network_session( 127 scoped_refptr<net::HttpNetworkSession> network_session(
125 new net::HttpNetworkSession(session_params)); 128 new net::HttpNetworkSession(session_params));
126 storage_.set_http_transaction_factory(new net::HttpCache( 129 storage_.set_http_transaction_factory(new net::HttpCache(
127 network_session.get(), net::HttpCache::DefaultBackend::InMemory(0))); 130 network_session.get(), net::HttpCache::DefaultBackend::InMemory(0)));
128 // In-memory cookie store. 131 // In-memory cookie store.
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 535
533 // Notify the delegate of completion. 536 // Notify the delegate of completion.
534 delegate_->OnCompletedConnectionTestExperiment(current, result); 537 delegate_->OnCompletedConnectionTestExperiment(current, result);
535 538
536 if (remaining_experiments_.empty()) { 539 if (remaining_experiments_.empty()) {
537 delegate_->OnCompletedConnectionTestSuite(); 540 delegate_->OnCompletedConnectionTestSuite();
538 } else { 541 } else {
539 StartNextExperiment(); 542 StartNextExperiment();
540 } 543 }
541 } 544 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/web_socket_proxy.cc ('k') | chrome/browser/net/connection_tester_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698