Index: chrome/browser/net/proxy_service_factory.cc |
diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/proxy_service_factory.cc |
index 96293f8a816a13186e58d7cb35d52b1e2be102ed..de478734b772ef35a6cfa308cb4b858761843ad4 100644 |
--- a/chrome/browser/net/proxy_service_factory.cc |
+++ b/chrome/browser/net/proxy_service_factory.cc |
@@ -7,6 +7,7 @@ |
#include <string> |
#include "base/command_line.h" |
+#include "base/metrics/field_trial.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/threading/thread.h" |
#include "chrome/browser/browser_process.h" |
@@ -38,6 +39,23 @@ |
using content::BrowserThread; |
+namespace { |
+ |
+#if !defined(OS_ANDROID) |
+bool EnableOutOfProcessV8Pac(const base::CommandLine& command_line) { |
+ const std::string group_name = |
+ base::FieldTrialList::FindFullName("OutOfProcessPac"); |
+ |
+ if (command_line.HasSwitch(switches::kDisableOutOfProcessPac)) |
+ return false; |
+ if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess)) |
+ return true; |
+ return group_name == "Enabled"; |
+} |
+#endif // !defined(OS_ANDROID) |
+ |
+} // namespace |
+ |
// static |
net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( |
PrefProxyConfigTracker* tracker) { |
@@ -144,14 +162,16 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService( |
#endif |
#if !defined(OS_ANDROID) |
- if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess)) { |
- proxy_service = net::CreateProxyServiceUsingMojoFactory( |
- UtilityProcessMojoProxyResolverFactory::GetInstance(), |
+ // In-process Mojo PAC can only be set on the command line, so it's presence |
eroman
2015/05/14 22:31:29
it's --> its
Anand Mistry (off Chromium)
2015/05/14 23:23:37
Done.
|
+ // should override other options. |
+ if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { |
+ proxy_service = net::CreateProxyServiceUsingMojoInProcess( |
proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
network_delegate); |
- } else if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { |
- proxy_service = net::CreateProxyServiceUsingMojoInProcess( |
+ } else if (EnableOutOfProcessV8Pac(command_line)) { |
+ proxy_service = net::CreateProxyServiceUsingMojoFactory( |
+ UtilityProcessMojoProxyResolverFactory::GetInstance(), |
proxy_config_service, new net::ProxyScriptFetcherImpl(context), |
dhcp_proxy_script_fetcher, context->host_resolver(), net_log, |
network_delegate); |