summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
authorericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-31 01:34:20 +0000
committerericroman@google.com <ericroman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-31 01:34:20 +0000
commit41b2780f0135d23196958816d3adcfd606b80f1e (patch)
tree306a00be7404dfc6d3ff9ef667d35827f87281a2 /webkit/glue/plugins
parent18a12354e6c3e1edf2f85e11cd7359127d2d3ce2 (diff)
downloadchromium_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/glue/plugins')
-rw-r--r--webkit/glue/plugins/mozilla_extensions.cc52
1 files changed, 2 insertions, 50 deletions
diff --git a/webkit/glue/plugins/mozilla_extensions.cc b/webkit/glue/plugins/mozilla_extensions.cc
index f3a00f9..f3e3195 100644
--- a/webkit/glue/plugins/mozilla_extensions.cc
+++ b/webkit/glue/plugins/mozilla_extensions.cc
@@ -10,8 +10,6 @@
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
-#include "net/proxy/proxy_service.h"
-#include "net/proxy/proxy_resolver_winhttp.h"
#include "third_party/npapi/bindings/npapi.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/glue/plugins/plugin_instance.h"
@@ -35,58 +33,12 @@ void MozillaExtensionApi::DetachFromInstance() {
bool MozillaExtensionApi::FindProxyForUrl(const char* url,
std::string* proxy) {
- bool result = false;
-
if ((!url) || (!proxy)) {
NOTREACHED();
- return result;
- }
-
- scoped_ptr<net::ProxyService> proxy_service(net::ProxyService::Create(NULL));
- if (!proxy_service.get()) {
- NOTREACHED();
- return result;
- }
-
- net::ProxyInfo proxy_info;
- if (proxy_service->ResolveProxy(GURL(std::string(url)),
- &proxy_info,
- NULL,
- NULL) == net::OK) {
- if (!proxy_info.is_direct()) {
- std::string winhttp_proxy = proxy_info.proxy_server();
-
- // Winhttp returns proxy in the the following format:
- // - HTTP proxy: "111.111.111.111:11"
- // -.SOCKS proxy: "socks=111.111.111.111:11"
- // - Mixed proxy: "http=111.111.111.111:11; socks=222.222.222.222:22"
- //
- // We need to translate this into the following format:
- // i) "DIRECT" -- no proxy
- // ii) "PROXY xxx.xxx.xxx.xxx" -- use proxy
- // iii) "SOCKS xxx.xxx.xxx.xxx" -- use SOCKS
- // iv) Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112",
- // "PROXY 111.111.111.111;SOCKS 112.112.112.112"....
- StringToLowerASCII(winhttp_proxy);
- if (std::string::npos == winhttp_proxy.find('=')) {
- // Proxy is in the form: "111.111.111.111:11"
- winhttp_proxy.insert(0, "http ");
- } else {
- // Proxy is in the following form.
- // -.SOCKS proxy: "socks=111.111.111.111:11"
- // - Mixed proxy: "http=111.111.111.111:11; socks=222.222.222.222:22"
- // in this case just replace the '=' with a space
- std::replace_if(winhttp_proxy.begin(),
- winhttp_proxy.end(),
- std::bind2nd(std::equal_to<char>(), '='), ' ');
- }
-
- *proxy = winhttp_proxy;
- result = true;
- }
+ return false;
}
- return result;
+ return webkit_glue::FindProxyForUrl(GURL(std::string(url)), proxy);
}
// nsISupports implementation