summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc17
-rw-r--r--chrome/browser/net/connection_tester.cc2
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/service/net/service_url_request_context.cc3
5 files changed, 25 insertions, 2 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 712fbf7..27fc4d7 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -96,9 +96,26 @@ net::ProxyService* CreateProxyService(
use_v8 = false; // Fallback to non-v8 implementation.
}
+ size_t num_pac_threads = 0u; // Use default number of threads.
+
+ // Check the command line for an override on the number of proxy resolver
+ // threads to use.
+ if (command_line.HasSwitch(switches::kNumPacThreads)) {
+ std::string s = command_line.GetSwitchValueASCII(switches::kNumPacThreads);
+
+ // Parse the switch (it should be a positive integer formatted as decimal).
+ int n;
+ if (StringToInt(s, &n) && n > 0) {
+ num_pac_threads = static_cast<size_t>(n);
+ } else {
+ LOG(ERROR) << "Invalid switch for number of PAC threads: " << s;
+ }
+ }
+
return net::ProxyService::Create(
proxy_config_service,
use_v8,
+ num_pac_threads,
context,
net_log,
io_loop);
diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc
index 26c2d1d..162be2c 100644
--- a/chrome/browser/net/connection_tester.cc
+++ b/chrome/browser/net/connection_tester.cc
@@ -151,7 +151,7 @@ class ExperimentURLRequestContext : public URLRequestContext {
}
*proxy_service = net::ProxyService::Create(config_service.release(), true,
- this, NULL, MessageLoop::current());
+ 0u, this, NULL, MessageLoop::current());
return net::OK;
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 365016b..6140243 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -632,6 +632,10 @@ const char kNoProxyServer[] = "no-proxy-server";
// Runs the renderer outside the sandbox.
const char kNoSandbox[] = "no-sandbox";
+// Specifies the maximum number of threads to use for running the Proxy
+// Autoconfig (PAC) script.
+const char kNumPacThreads[] = "num-pac-threads";
+
// Launch URL in new browser window.
const char kOpenInNewWindow[] = "new-window";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 71367dd..97eb92d 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -188,6 +188,7 @@ extern const char kNoJsRandomness[];
extern const char kNoProxyServer[];
extern const char kNoReferrers[];
extern const char kNoSandbox[];
+extern const char kNumPacThreads[];
extern const char kOpenInNewWindow[];
extern const char kPackExtension[];
extern const char kPackExtensionKey[];
diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc
index ee416fe..d33538b 100644
--- a/chrome/service/net/service_url_request_context.cc
+++ b/chrome/service/net/service_url_request_context.cc
@@ -31,7 +31,8 @@ ServiceURLRequestContext::ServiceURLRequestContext() {
g_service_process->io_thread()->message_loop(),
g_service_process->file_thread()->message_loop());
proxy_service_ =
- net::ProxyService::Create(proxy_config_service, false, this, NULL, NULL);
+ net::ProxyService::Create(
+ proxy_config_service, false, 0u, this, NULL, NULL);
ftp_transaction_factory_ = new net::FtpNetworkLayer(host_resolver_);
ssl_config_service_ = new net::SSLConfigServiceDefaults;
http_auth_handler_factory_ = net::HttpAuthHandlerFactory::CreateDefault();