summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_resolver_winhttp.cc
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-26 21:12:20 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-26 21:12:20 +0000
commit775fd9e3215360868781cb7bc615b0b4d782f0a9 (patch)
tree1436421924de756654737312b2dad652315981d1 /net/proxy/proxy_resolver_winhttp.cc
parent44d178bbf8cf937dc1180da5ccfd27ce9abe3f51 (diff)
downloadchromium_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.cc')
-rw-r--r--net/proxy/proxy_resolver_winhttp.cc18
1 files changed, 14 insertions, 4 deletions
diff --git a/net/proxy/proxy_resolver_winhttp.cc b/net/proxy/proxy_resolver_winhttp.cc
index a3ed9fe..d4bca9c5 100644
--- a/net/proxy/proxy_resolver_winhttp.cc
+++ b/net/proxy/proxy_resolver_winhttp.cc
@@ -45,7 +45,7 @@ static void FreeInfo(WINHTTP_PROXY_INFO* info) {
}
ProxyResolverWinHttp::ProxyResolverWinHttp()
- : ProxyResolver(true), session_handle_(NULL) {
+ : ProxyResolver(false /*expects_pac_bytes*/), session_handle_(NULL) {
}
ProxyResolverWinHttp::~ProxyResolverWinHttp() {
@@ -53,8 +53,9 @@ ProxyResolverWinHttp::~ProxyResolverWinHttp() {
}
int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url,
- const GURL& pac_url,
- ProxyInfo* results) {
+ ProxyInfo* results,
+ CompletionCallback* /*callback*/,
+ RequestHandle* /*request*/) {
// If we don't have a WinHTTP session, then create a new one.
if (!session_handle_ && !OpenWinHttpSession())
return ERR_FAILED;
@@ -68,7 +69,7 @@ int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url,
WINHTTP_AUTOPROXY_OPTIONS options = {0};
options.fAutoLogonIfChallenged = FALSE;
options.dwFlags = WINHTTP_AUTOPROXY_CONFIG_URL;
- std::wstring pac_url_wide = ASCIIToWide(pac_url.spec());
+ std::wstring pac_url_wide = ASCIIToWide(pac_url_.spec());
options.lpszAutoConfigUrl =
pac_url_wide.empty() ? L"http://wpad/wpad.dat" : pac_url_wide.c_str();
@@ -134,6 +135,15 @@ int ProxyResolverWinHttp::GetProxyForURL(const GURL& query_url,
return rv;
}
+void ProxyResolverWinHttp::CancelRequest(RequestHandle request) {
+ // This is a synchronous ProxyResolver; no possibility for async requests.
+ NOTREACHED();
+}
+
+void ProxyResolverWinHttp::SetPacScriptByUrlInternal(const GURL& pac_url) {
+ pac_url_ = pac_url;
+}
+
bool ProxyResolverWinHttp::OpenWinHttpSession() {
DCHECK(!session_handle_);
session_handle_ = WinHttpOpen(NULL,