summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 23:03:57 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-29 23:03:57 +0000
commit2dd868ff64f453c0da93c072986e1389836e8728 (patch)
tree89b767170d28968ffcdc7cf2b0770cfa2516da74 /webkit
parente8981b7eda49d88b74239c6c5dad5d0dd093a142 (diff)
downloadchromium_src-2dd868ff64f453c0da93c072986e1389836e8728.zip
chromium_src-2dd868ff64f453c0da93c072986e1389836e8728.tar.gz
chromium_src-2dd868ff64f453c0da93c072986e1389836e8728.tar.bz2
Stop using the default profile's proxy service for plugin proxy requests, and instead use the associated profile's proxy service. I proxy the IPC through the renderer first, as that makes it easy to get to the associated profile.
BUG=92361,64339 Review URL: http://codereview.chromium.org/7791005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98728 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/webkit_glue.h3
-rw-r--r--webkit/plugins/npapi/plugin_host.cc8
-rw-r--r--webkit/plugins/npapi/webplugin.h3
-rw-r--r--webkit/plugins/npapi/webplugin_impl.cc5
-rw-r--r--webkit/plugins/npapi/webplugin_impl.h1
-rw-r--r--webkit/tools/test_shell/simple_resource_loader_bridge.cc20
6 files changed, 16 insertions, 24 deletions
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index bc68662..aa94599 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -214,9 +214,6 @@ void GetPlugins(bool refresh,
// required by the media engine.
bool IsProtocolSupportedForMedia(const GURL& url);
-// Resolves the proxies for the url, returns true on success.
-bool FindProxyForUrl(const GURL& url, std::string* proxy_list);
-
// Returns the locale that this instance of webkit is running as. This is of
// the form language-country (e.g., en-US or pt-BR).
std::string GetWebKitLocale();
diff --git a/webkit/plugins/npapi/plugin_host.cc b/webkit/plugins/npapi/plugin_host.cc
index 7c41c1b..ec5b6c7 100644
--- a/webkit/plugins/npapi/plugin_host.cc
+++ b/webkit/plugins/npapi/plugin_host.cc
@@ -1006,9 +1006,15 @@ NPError NPN_GetValueForURL(NPP id,
switch (variable) {
case NPNURLVProxy: {
result = "DIRECT";
- if (!webkit_glue::FindProxyForUrl(GURL((std::string(url))), &result))
+ scoped_refptr<PluginInstance> plugin(FindInstance(id));
+ if (!plugin)
+ return NPERR_GENERIC_ERROR;
+
+ WebPlugin* webplugin = plugin->webplugin();
+ if (!webplugin)
return NPERR_GENERIC_ERROR;
+ result = webplugin->FindProxyForUrl(GURL(std::string(url)), &result);
break;
}
case NPNURLVCookie: {
diff --git a/webkit/plugins/npapi/webplugin.h b/webkit/plugins/npapi/webplugin.h
index a7c3110..10229b9 100644
--- a/webkit/plugins/npapi/webplugin.h
+++ b/webkit/plugins/npapi/webplugin.h
@@ -101,6 +101,9 @@ class WebPlugin {
// reference.
virtual NPObject* GetPluginElement() = 0;
+ // Resolves the proxies for the url, returns true on success.
+ virtual bool FindProxyForUrl(const GURL& url, std::string* proxy_list) = 0;
+
// Cookies
virtual void SetCookie(const GURL& url,
const GURL& first_party_for_cookies,
diff --git a/webkit/plugins/npapi/webplugin_impl.cc b/webkit/plugins/npapi/webplugin_impl.cc
index 8ca2b7e..764a071 100644
--- a/webkit/plugins/npapi/webplugin_impl.cc
+++ b/webkit/plugins/npapi/webplugin_impl.cc
@@ -702,6 +702,11 @@ NPObject* WebPluginImpl::GetPluginElement() {
return container_->scriptableObjectForElement();
}
+bool WebPluginImpl::FindProxyForUrl(const GURL& url, std::string* proxy_list) {
+ // Proxy resolving doesn't work in single-process mode.
+ return false;
+}
+
void WebPluginImpl::SetCookie(const GURL& url,
const GURL& first_party_for_cookies,
const std::string& cookie) {
diff --git a/webkit/plugins/npapi/webplugin_impl.h b/webkit/plugins/npapi/webplugin_impl.h
index 6963e42..61b7852 100644
--- a/webkit/plugins/npapi/webplugin_impl.h
+++ b/webkit/plugins/npapi/webplugin_impl.h
@@ -105,6 +105,7 @@ class WebPluginImpl : public WebPlugin,
virtual void InvalidateRect(const gfx::Rect& rect);
virtual NPObject* GetWindowScriptNPObject();
virtual NPObject* GetPluginElement();
+ virtual bool FindProxyForUrl(const GURL& url, std::string* proxy_list);
virtual void SetCookie(const GURL& url,
const GURL& first_party_for_cookies,
const std::string& cookie);
diff --git a/webkit/tools/test_shell/simple_resource_loader_bridge.cc b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
index 9138fdd..babefc1 100644
--- a/webkit/tools/test_shell/simple_resource_loader_bridge.cc
+++ b/webkit/tools/test_shell/simple_resource_loader_bridge.cc
@@ -54,7 +54,6 @@
#include "net/http/http_cache.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
-#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
#include "webkit/appcache/appcache_interfaces.h"
@@ -792,25 +791,6 @@ ResourceLoaderBridge* ResourceLoaderBridge::Create(
return new ResourceLoaderBridgeImpl(request_info);
}
-// Issue the proxy resolve request on the io thread, and wait
-// for the result.
-bool FindProxyForUrl(const GURL& url, std::string* proxy_list) {
- DCHECK(g_request_context);
-
- scoped_refptr<net::SyncProxyServiceHelper> sync_proxy_service(
- new net::SyncProxyServiceHelper(g_io_thread->message_loop(),
- g_request_context->proxy_service()));
-
- net::ProxyInfo proxy_info;
- int rv = sync_proxy_service->ResolveProxy(url, &proxy_info,
- net::BoundNetLog());
- if (rv == net::OK) {
- *proxy_list = proxy_info.ToPacString();
- }
-
- return rv == net::OK;
-}
-
} // namespace webkit_glue
//-----------------------------------------------------------------------------