summaryrefslogtreecommitdiffstats
path: root/chrome/plugin
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 00:34:27 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-23 00:34:27 +0000
commit65e82a56b3f1ca882db8c53f07781ecdc6cb7ece (patch)
treee224abcb3aa50320f55bf7a35bbf2e72ee0e0270 /chrome/plugin
parent52426e4c3b775666fa9fd52e1c52f8dbbbaadd49 (diff)
downloadchromium_src-65e82a56b3f1ca882db8c53f07781ecdc6cb7ece.zip
chromium_src-65e82a56b3f1ca882db8c53f07781ecdc6cb7ece.tar.gz
chromium_src-65e82a56b3f1ca882db8c53f07781ecdc6cb7ece.tar.bz2
Implement NPAPI HTTP Redirect handling. This basically supports the NPAPI URL redirect
notifications which are sent out from the browser while processing URL requests issued by the plugin via the NPN_GetURLNotify and NPN_PostURLNotify APIs. For more info please see https://wiki.mozilla.org/NPAPI:HTTPRedirectHandling As part of this CL we also block cross origin 307 POST url redirects. Test=Covered by NPAPI UI test GetURLRedirectNotification Bug=63030,63698 Review URL: http://codereview.chromium.org/5228007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67029 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin')
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc5
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h2
-rw-r--r--chrome/plugin/webplugin_proxy.cc9
-rw-r--r--chrome/plugin/webplugin_proxy.h5
4 files changed, 16 insertions, 5 deletions
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 5af56dd..ff0652d 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -196,12 +196,13 @@ void WebPluginDelegateStub::OnInit(const PluginMsg_Init_Params& params,
}
}
-void WebPluginDelegateStub::OnWillSendRequest(int id, const GURL& url) {
+void WebPluginDelegateStub::OnWillSendRequest(int id, const GURL& url,
+ int http_status_code) {
WebPluginResourceClient* client = webplugin_->GetResourceClient(id);
if (!client)
return;
- client->WillSendRequest(url);
+ client->WillSendRequest(url, http_status_code);
}
void WebPluginDelegateStub::OnDidReceiveResponse(
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 5bc2887..cbd2c97 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -57,7 +57,7 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
// Message handlers for the WebPluginDelegate calls that are proxied from the
// renderer over the IPC channel.
void OnInit(const PluginMsg_Init_Params& params, bool* result);
- void OnWillSendRequest(int id, const GURL& url);
+ void OnWillSendRequest(int id, const GURL& url, int http_status_code);
void OnDidReceiveResponse(const PluginMsg_DidReceiveResponseParams& params);
void OnDidReceiveData(int id, const std::vector<char>& buffer,
int data_offset);
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index f099963..0b04a94 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -315,7 +315,8 @@ void WebPluginProxy::HandleURLRequest(const char* url,
const char* buf,
unsigned int len,
int notify_id,
- bool popups_allowed) {
+ bool popups_allowed,
+ bool notify_redirects) {
if (!target && (0 == base::strcasecmp(method, "GET"))) {
// Please refer to https://bugzilla.mozilla.org/show_bug.cgi?id=366082
// for more details on this.
@@ -343,6 +344,7 @@ void WebPluginProxy::HandleURLRequest(const char* url,
params.notify_id = notify_id;
params.popups_allowed = popups_allowed;
+ params.notify_redirects = notify_redirects;
Send(new PluginHostMsg_URLRequest(route_id_, params));
}
@@ -725,3 +727,8 @@ void WebPluginProxy::ResourceClientDeleted(
}
}
}
+
+void WebPluginProxy::URLRedirectResponse(bool allow, int resource_id) {
+ Send(new PluginHostMsg_URLRedirectResponse(route_id_, allow, resource_id));
+}
+
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index 5a24e2bf..d9a4c67 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -120,7 +120,8 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
const char* buf,
unsigned int len,
int notify_id,
- bool popups_allowed);
+ bool popups_allowed,
+ bool notify_redirects);
void UpdateGeometry(const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
const TransportDIB::Handle& windowless_buffer,
@@ -176,6 +177,8 @@ class WebPluginProxy : public webkit_glue::WebPlugin {
virtual void FreeSurfaceDIB(TransportDIB::Id dib_id);
#endif
+ virtual void URLRedirectResponse(bool allow, int resource_id);
+
private:
bool Send(IPC::Message* msg);