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

Unified Diff: net/proxy/proxy_service.cc

Issue 118100: Avoid doing concurrent DNS resolves of the same hostname (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Get compiling on mac Created 11 years, 6 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
Index: net/proxy/proxy_service.cc
===================================================================
--- net/proxy/proxy_service.cc (revision 18213)
+++ net/proxy/proxy_service.cc (working copy)
@@ -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,9 +218,19 @@
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);

Powered by Google App Engine
This is Rietveld 408576698