summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins/plugin_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue/plugins/plugin_host.cc')
-rw-r--r--webkit/glue/plugins/plugin_host.cc27
1 files changed, 6 insertions, 21 deletions
diff --git a/webkit/glue/plugins/plugin_host.cc b/webkit/glue/plugins/plugin_host.cc
index 544597b..c8c652d 100644
--- a/webkit/glue/plugins/plugin_host.cc
+++ b/webkit/glue/plugins/plugin_host.cc
@@ -313,12 +313,7 @@ NPError NPN_RequestRead(NPStream* stream, NPByteRange* range_list) {
return NPERR_NO_ERROR;
}
-static bool IsJavaScriptUrl(const std::string& url) {
- return StartsWithASCII(url, "javascript:", false);
-}
-
-// Generic form of GetURL for common code between
-// GetURL() and GetURLNotify().
+// Generic form of GetURL for common code between GetURL and GetURLNotify.
static NPError GetURLNotify(NPP id,
const char* url,
const char* target,
@@ -327,18 +322,13 @@ static NPError GetURLNotify(NPP id,
if (!url)
return NPERR_INVALID_URL;
- bool is_javascript_url = IsJavaScriptUrl(url);
-
scoped_refptr<NPAPI::PluginInstance> plugin = FindInstance(id);
- if (plugin.get()) {
- plugin->webplugin()->HandleURLRequest(
- "GET", is_javascript_url, target, 0, 0, false,
- notify, url, reinterpret_cast<intptr_t>(notify_data),
- plugin->popups_allowed());
- } else {
+ if (!plugin.get()) {
NOTREACHED();
return NPERR_GENERIC_ERROR;
}
+
+ plugin->RequestURL(url, "GET", target, NULL, 0, notify, notify_data);
return NPERR_NO_ERROR;
}
@@ -385,8 +375,7 @@ NPError NPN_GetURL(NPP id, const char* url, const char* target) {
return GetURLNotify(id, url, target, false, 0);
}
-// Generic form of PostURL for common code between
-// PostURL() and PostURLNotify().
+// Generic form of PostURL for common code between PostURL and PostURLNotify.
static NPError PostURLNotify(NPP id,
const char* url,
const char* target,
@@ -460,8 +449,6 @@ static NPError PostURLNotify(NPP id,
len = post_file_contents.size();
}
- bool is_javascript_url = IsJavaScriptUrl(url);
-
// The post data sent by a plugin contains both headers
// and post data. Example:
// Content-type: text/html
@@ -472,9 +459,7 @@ static NPError PostURLNotify(NPP id,
// Unfortunately, our stream needs these broken apart,
// so we need to parse the data and set headers and data
// separately.
- plugin->webplugin()->HandleURLRequest(
- "POST", is_javascript_url, target, len, buf, false, notify, url,
- reinterpret_cast<intptr_t>(notify_data), plugin->popups_allowed());
+ plugin->RequestURL(url, "POST", target, buf, len, notify, notify_data);
return NPERR_NO_ERROR;
}