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_winhttp.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_winhttp.h')
-rw-r--r-- | net/proxy/proxy_resolver_winhttp.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/net/proxy/proxy_resolver_winhttp.h b/net/proxy/proxy_resolver_winhttp.h index 066fa6f..4932ba6 100644 --- a/net/proxy/proxy_resolver_winhttp.h +++ b/net/proxy/proxy_resolver_winhttp.h @@ -5,6 +5,9 @@ #ifndef NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ #define NET_PROXY_PROXY_RESOLVER_WINHTTP_H_ +#include <string> + +#include "googleurl/src/gurl.h" #include "net/proxy/proxy_resolver.h" typedef void* HINTERNET; // From winhttp.h @@ -16,20 +19,27 @@ namespace net { class ProxyResolverWinHttp : public ProxyResolver { public: ProxyResolverWinHttp(); - ~ProxyResolverWinHttp(); + virtual ~ProxyResolverWinHttp(); // ProxyResolver implementation: - virtual int GetProxyForURL(const GURL& query_url, - const GURL& pac_url, - ProxyInfo* results); + virtual int GetProxyForURL(const GURL& url, + ProxyInfo* results, + CompletionCallback* /*callback*/, + RequestHandle* /*request*/); + virtual void CancelRequest(RequestHandle request); private: - bool OpenWinHttpSession(); - void CloseWinHttpSession(); + // ProxyResolver implementation: + virtual void SetPacScriptByUrlInternal(const GURL& pac_url); + + bool OpenWinHttpSession(); + void CloseWinHttpSession(); // Proxy configuration is cached on the session handle. HINTERNET session_handle_; + GURL pac_url_; + DISALLOW_COPY_AND_ASSIGN(ProxyResolverWinHttp); }; |