Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 11193051: To fix the cross-site post submission bug. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix FileRead Permission Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_view_host_impl.cc
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
index c3067a29547f034484e207f5275f13558684330f..1a52fff25372ce0dc7ebe57b580fa739173bc191 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -992,6 +992,7 @@ bool RenderViewHostImpl::OnMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen,
OnMsgToggleFullscreen)
IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_OpenPostURL, OnMsgOpenPostURL)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange,
OnMsgDidContentsPreferredSizeChange)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeScrollbarsForMainFrame,
@@ -1365,6 +1366,21 @@ void RenderViewHostImpl::OnMsgOpenURL(const GURL& url,
this, validated_url, referrer, disposition, source_frame_id);
}
+void RenderViewHostImpl::OnMsgOpenPostURL(const GURL& url,
+ const content::Referrer& referrer,
+ WindowOpenDisposition disposition,
+ int64 source_frame_id,
+ std::vector<content::WebHTTPPOSTBodyParams> post_data) {
+ GURL validated_url(url);
+ FilterURL(ChildProcessSecurityPolicyImpl::GetInstance(),
+ GetProcess()->GetID(), false, &validated_url);
+
+ delegate_->RequestOpenPostURL(
+ this, validated_url, referrer, disposition, source_frame_id,
+ true, /* is_post */
michaeln 2012/10/23 23:22:18 Is the bool param needed for this method which see
irobert 2012/10/24 00:51:17 Yes. You are right. On 2012/10/23 23:22:18, micha
+ post_data /* post_data */);
+}
+
void RenderViewHostImpl::OnMsgDidContentsPreferredSizeChange(
const gfx::Size& new_size) {
delegate_->UpdatePreferredSize(new_size);

Powered by Google App Engine
This is Rietveld 408576698