diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 00:49:38 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-12 00:49:38 +0000 |
commit | 8a00f00ab5d68ffcc998fd04d2ca343af7cdf190 (patch) | |
tree | fd464ba49db4271c76c1cf8f769a22120ad631af /net/proxy/proxy_service.cc | |
parent | 77ae132c1bfdd986228b6f1c0d8c63baa441afdf (diff) | |
download | chromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.zip chromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.tar.gz chromium_src-8a00f00ab5d68ffcc998fd04d2ca343af7cdf190.tar.bz2 |
* Avoid doing concurrent DNS resolves of the same hostname in HostResolver.
* Add a 1 minute cache for host resolves.
* Refactor HostResolver to handle multiple requests.
* Make HostResolver a dependency of URLRequestContext. operate the HostResolver
in async mode for proxy resolver (bridging to IO thread).
TEST=unittests
BUG=13163
Review URL: http://codereview.chromium.org/118100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18236 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_service.cc')
-rw-r--r-- | net/proxy/proxy_service.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc index 65db636..3a0cd7f 100644 --- a/net/proxy/proxy_service.cc +++ b/net/proxy/proxy_service.cc @@ -23,6 +23,7 @@ #endif #include "net/proxy/proxy_resolver.h" #include "net/proxy/proxy_resolver_v8.h" +#include "net/url_request/url_request_context.h" using base::TimeDelta; using base::TimeTicks; @@ -217,8 +218,18 @@ ProxyService* ProxyService::Create( new ProxyConfigServiceFixed(*pc) : CreateSystemProxyConfigService(io_loop); - ProxyResolver* proxy_resolver = use_v8_resolver ? - new ProxyResolverV8() : CreateNonV8ProxyResolver(); + ProxyResolver* proxy_resolver; + + if (use_v8_resolver) { + // Send javascript errors and alerts to LOG(INFO). + HostResolver* host_resolver = url_request_context->host_resolver(); + ProxyResolverV8::JSBindings* js_bindings = + ProxyResolverV8::CreateDefaultBindings(host_resolver, io_loop); + + proxy_resolver = new ProxyResolverV8(js_bindings); + } else { + proxy_resolver = CreateNonV8ProxyResolver(); + } ProxyService* proxy_service = new ProxyService( proxy_config_service, proxy_resolver); |