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

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

Issue 10909245: Places that create a CookieMonster should also create a ServerBoundCertService. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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/threading/worker_pool.h"
15 #include "base/utf_string_conversions.h" 16 #include "base/utf_string_conversions.h"
16 #include "chrome/common/chrome_switches.h" 17 #include "chrome/common/chrome_switches.h"
17 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
18 #include "net/base/cert_verifier.h" 19 #include "net/base/cert_verifier.h"
20 #include "net/base/default_server_bound_cert_store.h"
19 #include "net/base/host_resolver.h" 21 #include "net/base/host_resolver.h"
20 #include "net/base/io_buffer.h" 22 #include "net/base/io_buffer.h"
21 #include "net/base/net_errors.h" 23 #include "net/base/net_errors.h"
22 #include "net/base/net_util.h" 24 #include "net/base/net_util.h"
25 #include "net/base/server_bound_cert_service.h"
23 #include "net/base/ssl_config_service_defaults.h" 26 #include "net/base/ssl_config_service_defaults.h"
24 #include "net/cookies/cookie_monster.h" 27 #include "net/cookies/cookie_monster.h"
25 #include "net/ftp/ftp_network_layer.h" 28 #include "net/ftp/ftp_network_layer.h"
26 #include "net/http/http_auth_handler_factory.h" 29 #include "net/http/http_auth_handler_factory.h"
27 #include "net/http/http_cache.h" 30 #include "net/http/http_cache.h"
28 #include "net/http/http_network_session.h" 31 #include "net/http/http_network_session.h"
29 #include "net/http/http_server_properties_impl.h" 32 #include "net/http/http_server_properties_impl.h"
30 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h" 33 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
31 #include "net/proxy/proxy_config_service_fixed.h" 34 #include "net/proxy/proxy_config_service_fixed.h"
32 #include "net/proxy/proxy_script_fetcher_impl.h" 35 #include "net/proxy/proxy_script_fetcher_impl.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 109
107 // The rest of the dependencies are standard, and don't depend on the 110 // The rest of the dependencies are standard, and don't depend on the
108 // experiment being run. 111 // experiment being run.
109 storage_.set_cert_verifier(net::CertVerifier::CreateDefault()); 112 storage_.set_cert_verifier(net::CertVerifier::CreateDefault());
110 storage_.set_ftp_transaction_factory( 113 storage_.set_ftp_transaction_factory(
111 new net::FtpNetworkLayer(host_resolver())); 114 new net::FtpNetworkLayer(host_resolver()));
112 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults); 115 storage_.set_ssl_config_service(new net::SSLConfigServiceDefaults);
113 storage_.set_http_auth_handler_factory( 116 storage_.set_http_auth_handler_factory(
114 net::HttpAuthHandlerFactory::CreateDefault(host_resolver())); 117 net::HttpAuthHandlerFactory::CreateDefault(host_resolver()));
115 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl); 118 storage_.set_http_server_properties(new net::HttpServerPropertiesImpl);
119 // In-memory server bound cert service.
120 storage_.set_server_bound_cert_service(new net::ServerBoundCertService(
121 new net::DefaultServerBoundCertStore(NULL),
122 base::WorkerPool::GetTaskRunner(true)));
116 123
117 net::HttpNetworkSession::Params session_params; 124 net::HttpNetworkSession::Params session_params;
118 session_params.host_resolver = host_resolver(); 125 session_params.host_resolver = host_resolver();
119 session_params.cert_verifier = cert_verifier(); 126 session_params.cert_verifier = cert_verifier();
127 session_params.server_bound_cert_service = server_bound_cert_service();
120 session_params.proxy_service = proxy_service(); 128 session_params.proxy_service = proxy_service();
121 session_params.ssl_config_service = ssl_config_service(); 129 session_params.ssl_config_service = ssl_config_service();
122 session_params.http_auth_handler_factory = http_auth_handler_factory(); 130 session_params.http_auth_handler_factory = http_auth_handler_factory();
123 session_params.http_server_properties = http_server_properties(); 131 session_params.http_server_properties = http_server_properties();
124 session_params.net_log = net_log; 132 session_params.net_log = net_log;
125 scoped_refptr<net::HttpNetworkSession> network_session( 133 scoped_refptr<net::HttpNetworkSession> network_session(
126 new net::HttpNetworkSession(session_params)); 134 new net::HttpNetworkSession(session_params));
127 storage_.set_http_transaction_factory(new net::HttpCache( 135 storage_.set_http_transaction_factory(new net::HttpCache(
128 network_session, 136 network_session,
129 net::HttpCache::DefaultBackend::InMemory(0))); 137 net::HttpCache::DefaultBackend::InMemory(0)));
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 532
525 // Notify the delegate of completion. 533 // Notify the delegate of completion.
526 delegate_->OnCompletedConnectionTestExperiment(current, result); 534 delegate_->OnCompletedConnectionTestExperiment(current, result);
527 535
528 if (remaining_experiments_.empty()) { 536 if (remaining_experiments_.empty()) {
529 delegate_->OnCompletedConnectionTestSuite(); 537 delegate_->OnCompletedConnectionTestSuite();
530 } else { 538 } else {
531 StartNextExperiment(); 539 StartNextExperiment();
532 } 540 }
533 } 541 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698