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

Unified Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2686943002: New WebContents created via ctrl-click should be in a new process. (Closed)
Patch Set: s/renderer/process/ in the field name + initializing the field and variables. Created 3 years, 8 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
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/security_exploit_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index ccd8ee7a90b9ac9e586d7e55cd15a34526814c05..0053821943f055ff767a79592e61f295a9570a8a 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1170,10 +1170,22 @@ void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) {
TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url",
validated_url.possibly_invalid_spec());
+ // When |params.disposition| asks OpenURL to create new contents, it always
+ // happens because of an explicit user request for new content creation (i.e.
+ // opening a link using ctrl-click or middle click). In such cases, the new
+ // content should be created in a new renderer to break opener relationship
+ // (see https://crbug.com/658386) and to conserve memory per renderer (see
+ // https://crbug.com/23815). Note that new content creation that wasn't
+ // explicitly requested by the user (i.e. left-clicking a link with
+ // target=_blank) goes through a different code path (through
+ // WebViewClient::CreateView).
+ bool kForceNewProcessForNewContents = true;
+
frame_tree_node_->navigator()->RequestOpenURL(
this, validated_url, params.uses_post, params.resource_request_body,
params.extra_headers, params.referrer, params.disposition,
- params.should_replace_current_entry, params.user_gesture);
+ kForceNewProcessForNewContents, params.should_replace_current_entry,
+ params.user_gesture);
}
void RenderFrameHostImpl::OnCancelInitialHistoryLoad() {
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/security_exploit_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698