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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2908433003: RenderFrameProxyHost::OnOpenURL needs to validate resource request body. (Closed)
Patch Set: Rebasing... Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 frame_tree_->RemoveFrame(frame_tree_node_); 1231 frame_tree_->RemoveFrame(frame_tree_node_);
1232 } 1232 }
1233 1233
1234 void RenderFrameHostImpl::OnFrameFocused() { 1234 void RenderFrameHostImpl::OnFrameFocused() {
1235 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); 1235 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance());
1236 } 1236 }
1237 1237
1238 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { 1238 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) {
1239 GURL validated_url(params.url); 1239 GURL validated_url(params.url);
1240 GetProcess()->FilterURL(false, &validated_url); 1240 GetProcess()->FilterURL(false, &validated_url);
1241 if (!ChildProcessSecurityPolicyImpl::GetInstance()->CanReadRequestBody(
1242 GetSiteInstance(), params.resource_request_body)) {
1243 bad_message::ReceivedBadMessage(GetProcess(),
1244 bad_message::RFH_ILLEGAL_UPLOAD_PARAMS);
1245 return;
1246 }
1241 1247
1242 if (params.is_history_navigation_in_new_child) { 1248 if (params.is_history_navigation_in_new_child) {
1243 // Try to find a FrameNavigationEntry that matches this frame instead, based 1249 // Try to find a FrameNavigationEntry that matches this frame instead, based
1244 // on the frame's unique name. If this can't be found, fall back to the 1250 // on the frame's unique name. If this can't be found, fall back to the
1245 // default params using RequestOpenURL below. 1251 // default params using RequestOpenURL below.
1246 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this, 1252 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this,
1247 validated_url)) 1253 validated_url))
1248 return; 1254 return;
1249 } 1255 }
1250 1256
(...skipping 2837 matching lines...) Expand 10 before | Expand all | Expand 10 after
4088 } 4094 }
4089 4095
4090 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 4096 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
4091 const std::string& interface_name, 4097 const std::string& interface_name,
4092 mojo::ScopedMessagePipeHandle pipe) { 4098 mojo::ScopedMessagePipeHandle pipe) {
4093 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 4099 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
4094 } 4100 }
4095 #endif 4101 #endif
4096 4102
4097 } // namespace content 4103 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/cross_site_transfer_browsertest.cc ('k') | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698