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

Unified Diff: net/proxy/proxy_service.cc

Issue 2893005: Change the default number of proxy resolver threads used for evaluating PAC s... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Address wtc comments Created 10 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 | « net/proxy/proxy_service.h ('k') | webkit/tools/test_shell/test_shell_request_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
===================================================================
--- net/proxy/proxy_service.cc (revision 51924)
+++ net/proxy/proxy_service.cc (working copy)
@@ -39,6 +39,7 @@
namespace net {
static const size_t kMaxNumNetLogEntries = 100;
+static const size_t kDefaultNumPacThreads = 4;
// Config getter that fails every time.
class ProxyConfigServiceNull : public ProxyConfigService {
@@ -264,9 +265,12 @@
ProxyService* ProxyService::Create(
ProxyConfigService* proxy_config_service,
bool use_v8_resolver,
+ size_t num_pac_threads,
URLRequestContext* url_request_context,
NetLog* net_log,
MessageLoop* io_loop) {
+ if (num_pac_threads == 0)
+ num_pac_threads = kDefaultNumPacThreads;
ProxyResolverFactory* sync_resolver_factory;
if (use_v8_resolver) {
@@ -278,10 +282,8 @@
sync_resolver_factory = new ProxyResolverFactoryForNonV8();
}
- const size_t kMaxNumResolverThreads = 1u;
ProxyResolver* proxy_resolver =
- new MultiThreadedProxyResolver(sync_resolver_factory,
- kMaxNumResolverThreads);
+ new MultiThreadedProxyResolver(sync_resolver_factory, num_pac_threads);
ProxyService* proxy_service =
new ProxyService(proxy_config_service, proxy_resolver, net_log);
@@ -298,7 +300,9 @@
// static
ProxyService* ProxyService::CreateFixed(const ProxyConfig& pc) {
- return Create(new ProxyConfigServiceFixed(pc), false, NULL, NULL, NULL);
+ // TODO(eroman): This isn't quite right, won't work if |pc| specifies
+ // a PAC script.
+ return Create(new ProxyConfigServiceFixed(pc), false, 0, NULL, NULL, NULL);
}
// static
« no previous file with comments | « net/proxy/proxy_service.h ('k') | webkit/tools/test_shell/test_shell_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698