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

Unified Diff: chrome/browser/io_thread.cc

Issue 2978443002: Make ProfileIOData use URLRequestContextBuilder (Closed)
Patch Set: Fix ChromeOS, extension throttles, merge Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 41cfd40339b1737eedaab4ca1485a68bfbd9fdc0..94c11dffa2acd8e25dcf309be56560d342acec9d 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -782,9 +782,37 @@ bool IOThread::PacHttpsUrlStrippingEnabled() const {
return pac_https_url_stripping_enabled_.GetValue();
}
-void IOThread::ConstructSystemRequestContext() {
+void IOThread::SetUpProxyConfigService(
+ net::URLRequestContextBuilderMojo* builder,
+ std::unique_ptr<net::ProxyConfigService> proxy_config_service) const {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
+
+ // TODO(eroman): Figure out why this doesn't work in single-process mode.
+ // Should be possible now that a private isolate is used.
+ // http://crbug.com/474654
+ if (!command_line.HasSwitch(switches::kWinHttpProxyResolver)) {
+ if (command_line.HasSwitch(switches::kSingleProcess)) {
+ LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
+ } else {
+ builder->set_mojo_proxy_resolver_factory(
+ ChromeMojoProxyResolverFactory::GetInstance());
+ }
+ }
+
+ builder->set_pac_quick_check_enabled(WpadQuickCheckEnabled());
+ builder->set_pac_sanitize_url_policy(
+ PacHttpsUrlStrippingEnabled()
+ ? net::ProxyService::SanitizeUrlPolicy::SAFE
+ : net::ProxyService::SanitizeUrlPolicy::UNSAFE);
+#if defined(OS_CHROMEOS)
+ builder->set_dhcp_fetcher_factory(
+ base::MakeUnique<chromeos::DhcpProxyScriptFetcherFactoryChromeos>());
+#endif
+ builder->set_proxy_config_service(std::move(proxy_config_service));
+}
+
+void IOThread::ConstructSystemRequestContext() {
net::URLRequestContextBuilderMojo builder;
builder.set_network_quality_estimator(
@@ -819,6 +847,8 @@ void IOThread::ConstructSystemRequestContext() {
base::MakeUnique<net::MultiThreadedCertVerifier>(
new chromeos::CertVerifyProcChromeOS())));
#else
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
command_line, net::CertVerifier::CreateDefault()));
UMA_HISTOGRAM_BOOLEAN(
@@ -836,28 +866,7 @@ void IOThread::ConstructSystemRequestContext() {
builder.set_ct_verifier(std::move(ct_verifier));
- // TODO(eroman): Figure out why this doesn't work in single-process mode.
- // Should be possible now that a private isolate is used.
- // http://crbug.com/474654
- if (!command_line.HasSwitch(switches::kWinHttpProxyResolver)) {
- if (command_line.HasSwitch(switches::kSingleProcess)) {
- LOG(ERROR) << "Cannot use V8 Proxy resolver in single process mode.";
- } else {
- builder.set_mojo_proxy_resolver_factory(
- ChromeMojoProxyResolverFactory::GetInstance());
- }
- }
-
- builder.set_pac_quick_check_enabled(WpadQuickCheckEnabled());
- builder.set_pac_sanitize_url_policy(
- PacHttpsUrlStrippingEnabled()
- ? net::ProxyService::SanitizeUrlPolicy::SAFE
- : net::ProxyService::SanitizeUrlPolicy::UNSAFE);
-#if defined(OS_CHROMEOS)
- builder.set_dhcp_fetcher_factory(
- base::MakeUnique<chromeos::DhcpProxyScriptFetcherFactoryChromeos>());
-#endif
- builder.set_proxy_config_service(std::move(system_proxy_config_service_));
+ SetUpProxyConfigService(&builder, std::move(system_proxy_config_service_));
builder.set_http_network_session_params(session_params_);

Powered by Google App Engine
This is Rietveld 408576698