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

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: Second round of feedback Created 5 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 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 0c9bcb9e2e9f094c44e67b93d7f73fe153ae1d39..4734b86fbd65186c9200b9be533c4cf2f26b9fea 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -1212,9 +1212,23 @@ 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.
- delegate_->DidDisownOpener(this);
+ // This message is only sent for top-level frames for now.
+ // TODO(alexmos): This should eventually support subframe openers as well,
+ // and it should allow openers to be updated to another frame (which can
+ // happen via window.open('','framename')) in addition to being disowned.
+
+ // 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 other RenderFrameHosts and RenderFrameProxies for this frame.
+ // This is important 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) {
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.h ('k') | content/browser/renderer_host/render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698