diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-26 21:12:20 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-26 21:12:20 +0000 |
commit | 775fd9e3215360868781cb7bc615b0b4d782f0a9 (patch) | |
tree | 1436421924de756654737312b2dad652315981d1 /net/proxy/proxy_resolver_v8.h | |
parent | 44d178bbf8cf937dc1180da5ccfd27ce9abe3f51 (diff) | |
download | chromium_src-775fd9e3215360868781cb7bc615b0b4d782f0a9.zip chromium_src-775fd9e3215360868781cb7bc615b0b4d782f0a9.tar.gz chromium_src-775fd9e3215360868781cb7bc615b0b4d782f0a9.tar.bz2 |
Remove the concept of threading from ProxyService, and move it into the ProxyResolver dependency.
ProxyResolver may now complete requests asynchronously, and is defined to handle multiple requests.
The code from ProxyService that queued requests onto the single PAC thread has moved into SingleThreadedProxyResolver.
This refactor lays the groundwork for:
(1) http://crbug.com/11746 -- Run PAC proxy resolving out of process.
(Can inject an IPC bridge implementation of ProxyResolver)
(2) http://crbug.com/11079 -- Run PAC proxy resolving on multiple threads.
(Can implement a MultithreadedProxyResolver type class; still complications around v8 threadsafety though).
BUG=http://crbug.com/11746, http://crbug.com/11079
TEST=existing unit-tests.
Review URL: http://codereview.chromium.org/149525
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_resolver_v8.h')
-rw-r--r-- | net/proxy/proxy_resolver_v8.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/net/proxy/proxy_resolver_v8.h b/net/proxy/proxy_resolver_v8.h index 6fbc968..4c364e5 100644 --- a/net/proxy/proxy_resolver_v8.h +++ b/net/proxy/proxy_resolver_v8.h @@ -43,13 +43,14 @@ class ProxyResolverV8 : public ProxyResolver { // is destroyed. explicit ProxyResolverV8(JSBindings* custom_js_bindings); - ~ProxyResolverV8(); + virtual ~ProxyResolverV8(); // ProxyResolver implementation: - virtual int GetProxyForURL(const GURL& query_url, - const GURL& /*pac_url*/, - ProxyInfo* results); - virtual void SetPacScript(const std::string& bytes); + virtual int GetProxyForURL(const GURL& url, + ProxyInfo* results, + CompletionCallback* /*callback*/, + RequestHandle* /*request*/); + virtual void CancelRequest(RequestHandle request); JSBindings* js_bindings() const { return js_bindings_.get(); } @@ -71,8 +72,12 @@ class ProxyResolverV8 : public ProxyResolver { private: // Context holds the Javascript state for the most recently loaded PAC // script. It corresponds with the data from the last call to - // SetPacScript(). + // SetPacScriptByDataInternal(). class Context; + + // ProxyResolver implementation: + virtual void SetPacScriptByDataInternal(const std::string& bytes); + scoped_ptr<Context> context_; scoped_ptr<JSBindings> js_bindings_; |