Skip to content

Commit

Permalink
Add the capability to run multiple proxy PAC scripts in parallel.
Browse files Browse the repository at this point in the history
Refactors SingleThreadedProxyResolver into MultiThreadedProxyResolver.

New threads are created lazily on demand, up to a fixed maximum.

Note that this CL does NOT change the policy in Chrome -- it will continue to use a single thread for proxy resolving, but using the new code to do so.

BUG=11079
Review URL: http://codereview.chromium.org/2822043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51877 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
eroman@chromium.org committed Jul 8, 2010
1 parent b5edb84 commit b376421
Show file tree
Hide file tree
Showing 20 changed files with 1,192 additions and 594 deletions.
3 changes: 3 additions & 0 deletions net/base/host_resolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ class HostResolver : public base::RefCounted<HostResolver> {
// additional functionality on the about:net-internals page.
virtual HostResolverImpl* GetAsHostResolverImpl() { return NULL; }

// Does additional cleanup prior to destruction.
virtual void Shutdown() {}

protected:
friend class base::RefCounted<HostResolver>;

Expand Down
2 changes: 1 addition & 1 deletion net/base/host_resolver_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class HostResolverImpl : public HostResolver,
virtual HostResolverImpl* GetAsHostResolverImpl() { return this; }

// TODO(eroman): hack for http://crbug.com/15513
void Shutdown();
virtual void Shutdown();

// Returns the cache this resolver uses, or NULL if caching is disabled.
HostCache* cache() { return cache_.get(); }
Expand Down
13 changes: 11 additions & 2 deletions net/base/net_log_event_type_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,18 @@ EVENT_TYPE(PROXY_RESOLVER_V8_DNS_RESOLVE)
// Measures the time taken to execute the "dnsResolveEx()" javascript binding.
EVENT_TYPE(PROXY_RESOLVER_V8_DNS_RESOLVE_EX)

// Measures the time that a proxy resolve request was stalled waiting for the
// Measures the time that a proxy resolve request was stalled waiting for a
// proxy resolver thread to free-up.
EVENT_TYPE(WAITING_FOR_SINGLE_PROXY_RESOLVER_THREAD)
EVENT_TYPE(WAITING_FOR_PROXY_RESOLVER_THREAD)

// This event is emitted just before a PAC request is bound to a thread. It
// contains these parameters:
//
// {
// "thread_number": <Identifier for the PAC thread that is going to
// run this request>
// }
EVENT_TYPE(SUBMITTED_TO_RESOLVER_THREAD)

// ------------------------------------------------------------------------
// ClientSocket
Expand Down
6 changes: 3 additions & 3 deletions net/net.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@
'ocsp/nss_ocsp.h',
'proxy/init_proxy_resolver.cc',
'proxy/init_proxy_resolver.h',
'proxy/multi_threaded_proxy_resolver.cc',
'proxy/multi_threaded_proxy_resolver.h',
'proxy/proxy_bypass_rules.cc',
'proxy/proxy_bypass_rules.h',
'proxy/proxy_config.cc',
Expand Down Expand Up @@ -431,8 +433,6 @@
'proxy/proxy_server.h',
'proxy/proxy_service.cc',
'proxy/proxy_service.h',
'proxy/single_threaded_proxy_resolver.cc',
'proxy/single_threaded_proxy_resolver.h',
'proxy/sync_host_resolver_bridge.cc',
'proxy/sync_host_resolver_bridge.h',
'socket/client_socket.h',
Expand Down Expand Up @@ -723,6 +723,7 @@
'http/url_security_manager_unittest.cc',
'proxy/init_proxy_resolver_unittest.cc',
'proxy/mock_proxy_resolver.h',
'proxy/multi_threaded_proxy_resolver_unittest.cc',
'proxy/proxy_bypass_rules_unittest.cc',
'proxy/proxy_config_service_linux_unittest.cc',
'proxy/proxy_config_service_win_unittest.cc',
Expand All @@ -733,7 +734,6 @@
'proxy/proxy_script_fetcher_unittest.cc',
'proxy/proxy_server_unittest.cc',
'proxy/proxy_service_unittest.cc',
'proxy/single_threaded_proxy_resolver_unittest.cc',
'proxy/sync_host_resolver_bridge_unittest.cc',
'socket/client_socket_pool_base_unittest.cc',
'socket/socks5_client_socket_unittest.cc',
Expand Down
Loading

0 comments on commit b376421

Please sign in to comment.