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

Unified Diff: chrome/browser/io_thread.cc

Issue 2978443002: Make ProfileIOData use URLRequestContextBuilder (Closed)
Patch Set: Response to comments 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
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/proxy_service_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index be6e9b60518f1bb92b3c973233cb8cbee6c130d2..81bd05d8ed7f164814911bb917724d7b4d90b036 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -787,9 +787,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());
+#if defined(OS_CHROMEOS)
+ builder->set_dhcp_fetcher_factory(
+ base::MakeUnique<chromeos::DhcpProxyScriptFetcherFactoryChromeos>());
+#endif
+ }
+ }
+
+ builder->set_pac_quick_check_enabled(WpadQuickCheckEnabled());
+ builder->set_pac_sanitize_url_policy(
+ PacHttpsUrlStrippingEnabled()
+ ? net::ProxyService::SanitizeUrlPolicy::SAFE
+ : net::ProxyService::SanitizeUrlPolicy::UNSAFE);
+ builder->set_proxy_config_service(std::move(proxy_config_service));
+}
+
+void IOThread::ConstructSystemRequestContext() {
std::unique_ptr<net::URLRequestContextBuilderMojo> builder =
base::MakeUnique<net::URLRequestContextBuilderMojo>();
@@ -828,6 +856,8 @@ void IOThread::ConstructSystemRequestContext() {
#else
cert_verifier = net::CertVerifier::CreateDefault();
#endif
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
builder->SetCertVerifier(
content::IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
command_line, switches::kUserDataDir, std::move(cert_verifier)));
@@ -845,28 +875,8 @@ 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.get(),
+ std::move(system_proxy_config_service_));
builder->set_http_network_session_params(session_params_);
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/proxy_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698