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_mac.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_mac.h')
-rw-r--r-- | net/proxy/proxy_resolver_mac.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/proxy/proxy_resolver_mac.h b/net/proxy/proxy_resolver_mac.h index 8413624..58f6096 100644 --- a/net/proxy/proxy_resolver_mac.h +++ b/net/proxy/proxy_resolver_mac.h @@ -5,6 +5,9 @@ #ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_ #define NET_PROXY_PROXY_RESOLVER_MAC_H_ +#include <string> + +#include "googleurl/src/gurl.h" #include "net/proxy/proxy_config_service.h" #include "net/proxy/proxy_resolver.h" @@ -14,12 +17,24 @@ namespace net { // proxies. class ProxyResolverMac : public ProxyResolver { public: - ProxyResolverMac() : ProxyResolver(true) {} + ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {} // ProxyResolver methods: - 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) { + NOTREACHED(); + } + + private: + virtual void SetPacScriptByUrlInternal(const GURL& pac_url) { + pac_url_ = pac_url; + } + + GURL pac_url_; }; class ProxyConfigServiceMac : public ProxyConfigService { |