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

Unified Diff: net/proxy/proxy_resolver_v8.h

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_resolver_v8.h
===================================================================
--- net/proxy/proxy_resolver_v8.h (revision 18213)
+++ net/proxy/proxy_resolver_v8.h (working copy)
@@ -10,8 +10,12 @@
#include "base/scoped_ptr.h"
#include "net/proxy/proxy_resolver.h"
+class MessageLoop;
+
namespace net {
+class HostResolver;
+
// Implementation of ProxyResolver that uses V8 to evaluate PAC scripts.
//
// ----------------------------------------------------------------------------
@@ -32,19 +36,6 @@
// and does not use locking since it expects to be alone.
class ProxyResolverV8 : public ProxyResolver {
public:
- // Constructs a ProxyResolverV8 with default javascript bindings.
- //
- // The default javascript bindings will:
- // - Send script error messages to LOG(INFO)
- // - Send script alert()s to LOG(INFO)
- // - Use the default host mapper to service dnsResolve(), synchronously
- // on the V8 thread.
- //
- // For clients that need more control (for example, sending the script output
- // to a UI widget), use the ProxyResolverV8(JSBindings*) and specify your
- // own bindings.
- ProxyResolverV8();
-
class JSBindings;
// Constructs a ProxyResolverV8 with custom bindings. ProxyResolverV8 takes
@@ -62,6 +53,21 @@
JSBindings* js_bindings() const { return js_bindings_.get(); }
+ // Creates a default javascript bindings implementation that will:
+ // - Send script error messages to LOG(INFO)
+ // - Send script alert()s to LOG(INFO)
+ // - Use the provided host mapper to service dnsResolve().
+ //
+ // For clients that need more control (for example, sending the script output
+ // to a UI widget), use the ProxyResolverV8(JSBindings*) and specify your
+ // own bindings.
+ //
+ // |host_resolver| will be used in async mode on |host_resolver_loop|. If
+ // |host_resolver_loop| is NULL, then |host_resolver| will be used in sync
+ // mode on the PAC thread.
+ static JSBindings* CreateDefaultBindings(HostResolver* host_resolver,
+ MessageLoop* host_resolver_loop);
+
private:
// Context holds the Javascript state for the most recently loaded PAC
// script. It corresponds with the data from the last call to

Powered by Google App Engine
This is Rietveld 408576698