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

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

Issue 2921753002: NOT YET READY: Making chrome.windows.create establish an actual "opener" relationship.
Patch Set: Adding setSelfAsOpener parameter. Created 3 years, 6 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 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 // on the frame's unique name. If this can't be found, fall back to the 1259 // on the frame's unique name. If this can't be found, fall back to the
1260 // default params using RequestOpenURL below. 1260 // default params using RequestOpenURL below.
1261 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this, 1261 if (frame_tree_node_->navigator()->NavigateNewChildFrame(this,
1262 validated_url)) 1262 validated_url))
1263 return; 1263 return;
1264 } 1264 }
1265 1265
1266 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url", 1266 TRACE_EVENT1("navigation", "RenderFrameHostImpl::OpenURL", "url",
1267 validated_url.possibly_invalid_spec()); 1267 validated_url.possibly_invalid_spec());
1268 1268
1269 // When |params.disposition| asks OpenURL to create new contents, it always
1270 // happens because of an explicit user request for new content creation (i.e.
1271 // opening a link using ctrl-click or middle click). In such cases, the new
1272 // content should be created in a new renderer to break opener relationship
1273 // (see https://crbug.com/658386) and to conserve memory per renderer (see
1274 // https://crbug.com/23815). Note that new content creation that wasn't
1275 // explicitly requested by the user (i.e. left-clicking a link with
1276 // target=_blank) goes through a different code path (through
1277 // WebViewClient::CreateView).
1278 bool kForceNewProcessForNewContents = true;
1279
1280 frame_tree_node_->navigator()->RequestOpenURL( 1269 frame_tree_node_->navigator()->RequestOpenURL(
1281 this, validated_url, params.uses_post, params.resource_request_body, 1270 this, validated_url, params.uses_post, params.resource_request_body,
1282 params.extra_headers, params.referrer, params.disposition, 1271 params.extra_headers, params.referrer, params.disposition,
1283 kForceNewProcessForNewContents, params.should_replace_current_entry, 1272 params.should_replace_current_entry, params.user_gesture);
1284 params.user_gesture);
1285 } 1273 }
1286 1274
1287 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() { 1275 void RenderFrameHostImpl::OnCancelInitialHistoryLoad() {
1288 // A Javascript navigation interrupted the initial history load. Check if an 1276 // A Javascript navigation interrupted the initial history load. Check if an
1289 // initial subframe cross-process navigation needs to be canceled as a result. 1277 // initial subframe cross-process navigation needs to be canceled as a result.
1290 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate. 1278 // TODO(creis, clamy): Cancel any cross-process navigation in PlzNavigate.
1291 if (GetParent() && !frame_tree_node_->has_committed_real_load() && 1279 if (GetParent() && !frame_tree_node_->has_committed_real_load() &&
1292 frame_tree_node_->render_manager()->pending_frame_host()) { 1280 frame_tree_node_->render_manager()->pending_frame_host()) {
1293 frame_tree_node_->render_manager()->CancelPendingIfNecessary( 1281 frame_tree_node_->render_manager()->CancelPendingIfNecessary(
1294 frame_tree_node_->render_manager()->pending_frame_host()); 1282 frame_tree_node_->render_manager()->pending_frame_host());
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
4109 } 4097 }
4110 4098
4111 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 4099 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
4112 const std::string& interface_name, 4100 const std::string& interface_name,
4113 mojo::ScopedMessagePipeHandle pipe) { 4101 mojo::ScopedMessagePipeHandle pipe) {
4114 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 4102 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
4115 } 4103 }
4116 #endif 4104 #endif
4117 4105
4118 } // namespace content 4106 } // namespace content
OLDNEW
« 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