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

Unified Diff: chrome/browser/net/proxy_service_factory.cc

Issue 1124083004: Add a field trial to enable out-of-process V8 pac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comment. Created 5 years, 7 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/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7ec1ac30ffbabacfe337518d51228ac58ea12092 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 its presence
+ // 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);
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698