Commit 5cd812f6 authored by amistry's avatar amistry Committed by Commit bot

Add a field trial to enable out-of-process V8 pac.

At the same time, add a "disable" flag as an escape hatch for when
things go bad.

BUG=467832

Review URL: https://codereview.chromium.org/1124083004

Cr-Commit-Position: refs/heads/master@{#330175}
parent e365ba1a
...@@ -2341,7 +2341,8 @@ const Experiment kExperiments[] = { ...@@ -2341,7 +2341,8 @@ const Experiment kExperiments[] = {
IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME, IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_NAME,
IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION, IDS_FLAGS_V8_PAC_MOJO_OUT_OF_PROCESS_DESCRIPTION,
kOsDesktop, kOsDesktop,
SINGLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess), ENABLE_DISABLE_VALUE_TYPE(switches::kV8PacMojoOutOfProcess,
switches::kDisableOutOfProcessPac)
}, },
#if defined(ENABLE_MEDIA_ROUTER) #if defined(ENABLE_MEDIA_ROUTER)
{ {
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <string> #include <string>
#include "base/command_line.h" #include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
...@@ -38,6 +39,23 @@ ...@@ -38,6 +39,23 @@
using content::BrowserThread; 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 // static
net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService( net::ProxyConfigService* ProxyServiceFactory::CreateProxyConfigService(
PrefProxyConfigTracker* tracker) { PrefProxyConfigTracker* tracker) {
...@@ -144,14 +162,16 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService( ...@@ -144,14 +162,16 @@ net::ProxyService* ProxyServiceFactory::CreateProxyService(
#endif #endif
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kV8PacMojoOutOfProcess)) { // In-process Mojo PAC can only be set on the command line, so its presence
proxy_service = net::CreateProxyServiceUsingMojoFactory( // should override other options.
UtilityProcessMojoProxyResolverFactory::GetInstance(), if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) {
proxy_service = net::CreateProxyServiceUsingMojoInProcess(
proxy_config_service, new net::ProxyScriptFetcherImpl(context), proxy_config_service, new net::ProxyScriptFetcherImpl(context),
dhcp_proxy_script_fetcher, context->host_resolver(), net_log, dhcp_proxy_script_fetcher, context->host_resolver(), net_log,
network_delegate); network_delegate);
} else if (command_line.HasSwitch(switches::kV8PacMojoInProcess)) { } else if (EnableOutOfProcessV8Pac(command_line)) {
proxy_service = net::CreateProxyServiceUsingMojoInProcess( proxy_service = net::CreateProxyServiceUsingMojoFactory(
UtilityProcessMojoProxyResolverFactory::GetInstance(),
proxy_config_service, new net::ProxyScriptFetcherImpl(context), proxy_config_service, new net::ProxyScriptFetcherImpl(context),
dhcp_proxy_script_fetcher, context->host_resolver(), net_log, dhcp_proxy_script_fetcher, context->host_resolver(), net_log,
network_delegate); network_delegate);
......
...@@ -291,6 +291,9 @@ const char kDisableOfflineAutoReload[] = "disable-offline-auto-reload"; ...@@ -291,6 +291,9 @@ const char kDisableOfflineAutoReload[] = "disable-offline-auto-reload";
const char kDisableOfflineAutoReloadVisibleOnly[] = const char kDisableOfflineAutoReloadVisibleOnly[] =
"disable-offline-auto-reload-visible-only"; "disable-offline-auto-reload-visible-only";
// Disable out-of-process V8 proxy resolver.
const char kDisableOutOfProcessPac[] = "disable-out-of-process-pac";
// Disable the setting to prompt the user for their OS account password before // Disable the setting to prompt the user for their OS account password before
// revealing plaintext passwords in the password manager. // revealing plaintext passwords in the password manager.
const char kDisablePasswordManagerReauthentication[] = const char kDisablePasswordManagerReauthentication[] =
......
...@@ -86,6 +86,7 @@ extern const char kDisableNewOfflineErrorPage[]; ...@@ -86,6 +86,7 @@ extern const char kDisableNewOfflineErrorPage[];
extern const char kDisableNTPOtherSessionsMenu[]; extern const char kDisableNTPOtherSessionsMenu[];
extern const char kDisableOfflineAutoReload[]; extern const char kDisableOfflineAutoReload[];
extern const char kDisableOfflineAutoReloadVisibleOnly[]; extern const char kDisableOfflineAutoReloadVisibleOnly[];
extern const char kDisableOutOfProcessPac[];
extern const char kDisablePasswordManagerReauthentication[]; extern const char kDisablePasswordManagerReauthentication[];
extern const char kDisablePdfMaterialUI[]; extern const char kDisablePdfMaterialUI[];
extern const char kDisablePermissionsBubbles[]; extern const char kDisablePermissionsBubbles[];
......
...@@ -56564,6 +56564,7 @@ To add a new entry, add it with any value and run test to compute valid value. ...@@ -56564,6 +56564,7 @@ To add a new entry, add it with any value and run test to compute valid value.
<int value="-1835975804" label="disable-offline-auto-reload"/> <int value="-1835975804" label="disable-offline-auto-reload"/>
<int value="-1833149810" label="enable-accessibility-tab-switcher"/> <int value="-1833149810" label="enable-accessibility-tab-switcher"/>
<int value="-1832575380" label="show-saved-copy"/> <int value="-1832575380" label="show-saved-copy"/>
<int value="-1832221649" label="disable-out-of-process-pac"/>
<int value="-1821058653" label="enable-delay-agnostic-aec"/> <int value="-1821058653" label="enable-delay-agnostic-aec"/>
<int value="-1767470652" label="out-of-process-pdf"/> <int value="-1767470652" label="out-of-process-pdf"/>
<int value="-1751928267" label="disable-icon-ntp"/> <int value="-1751928267" label="disable-icon-ntp"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment