diff options
author | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-31 01:34:20 +0000 |
---|---|---|
committer | ericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-31 01:34:20 +0000 |
commit | 41b2780f0135d23196958816d3adcfd606b80f1e (patch) | |
tree | 306a00be7404dfc6d3ff9ef667d35827f87281a2 /webkit/tools/test_shell | |
parent | 18a12354e6c3e1edf2f85e11cd7359127d2d3ce2 (diff) | |
download | chromium_src-41b2780f0135d23196958816d3adcfd606b80f1e.zip chromium_src-41b2780f0135d23196958816d3adcfd606b80f1e.tar.gz chromium_src-41b2780f0135d23196958816d3adcfd606b80f1e.tar.bz2 |
Move proxy resolve requests out of plugin/renderer process, and into the browser.
Review URL: http://codereview.chromium.org/14142
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9006 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r-- | webkit/tools/test_shell/simple_resource_loader_bridge.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc index e5b1aff..d7737f3 100644 --- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc +++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc @@ -40,6 +40,7 @@ #include "net/base/io_buffer.h" #include "net/base/net_util.h" #include "net/base/upload_data.h" +#include "net/proxy/proxy_service.h" #include "net/url_request/url_request.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/tools/test_shell/test_shell_request_context.h" @@ -526,6 +527,24 @@ std::string GetCookies(const GURL& url, const GURL& policy_url) { return getter->GetResult(); } +// Issue the proxy resolve request on the io thread, and wait +// for the result. +bool FindProxyForUrl(const GURL& url, std::string* proxy_list) { + DCHECK(request_context); + + scoped_refptr<net::SyncProxyServiceHelper> sync_proxy_service( + new net::SyncProxyServiceHelper(io_thread->message_loop(), + request_context->proxy_service())); + + net::ProxyInfo proxy_info; + int rv = sync_proxy_service->ResolveProxy(url, &proxy_info); + if (rv == net::OK) { + *proxy_list = proxy_info.GetAnnotatedProxyList(); + } + + return rv == net::OK; +} + } // namespace webkit_glue //----------------------------------------------------------------------------- |