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

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

Issue 1086283002: Track frame openers in FrameTreeNodes instead of WebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup in WebContentsImpl Created 5 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 side-by-side diff with in-line comments
Download patch
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 cc0ad50ff53128a6702981667a49762ad371388b..997b89364457b29b4f3f91f8e61986737cd7a0e8 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1224,7 +1224,19 @@ void RenderFrameHostImpl::OnDidAccessInitialDocument() {
void RenderFrameHostImpl::OnDidDisownOpener() {
// This message is only sent for top-level frames. TODO(avi): when frame tree
// mirroring works correctly, add a check here to enforce it.
Charlie Reis 2015/06/03 20:01:37 If this is still main-frame only for now, we can p
alexmos 2015/06/05 22:34:31 Done.
- delegate_->DidDisownOpener(this);
+
+ // No action is necessary if the opener has already been cleared.
+ if (!frame_tree_node_->opener())
+ return;
+
+ // Clear our opener so that future cross-process navigations don't have an
+ // opener assigned.
+ frame_tree_node_->SetOpener(nullptr);
+
+ // Notify all swapped out RenderViewHosts for this tab. This is important
Charlie Reis 2015/06/03 20:01:37 I think this comment was stale. It's notifying al
alexmos 2015/06/05 22:34:31 Done.
+ // in case we go back to them, or if another window in those processes tries
+ // to access window.opener.
+ frame_tree_node_->render_manager()->DidDisownOpener(this);
}
void RenderFrameHostImpl::OnDidChangeName(const std::string& name) {

Powered by Google App Engine
This is Rietveld 408576698