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

Side by Side 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, 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 render_view_host_->OnTextSurroundingSelectionResponse( 1216 render_view_host_->OnTextSurroundingSelectionResponse(
1217 content, start_offset, end_offset); 1217 content, start_offset, end_offset);
1218 } 1218 }
1219 1219
1220 void RenderFrameHostImpl::OnDidAccessInitialDocument() { 1220 void RenderFrameHostImpl::OnDidAccessInitialDocument() {
1221 delegate_->DidAccessInitialDocument(); 1221 delegate_->DidAccessInitialDocument();
1222 } 1222 }
1223 1223
1224 void RenderFrameHostImpl::OnDidDisownOpener() { 1224 void RenderFrameHostImpl::OnDidDisownOpener() {
1225 // This message is only sent for top-level frames. TODO(avi): when frame tree 1225 // This message is only sent for top-level frames. TODO(avi): when frame tree
1226 // mirroring works correctly, add a check here to enforce it. 1226 // 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.
1227 delegate_->DidDisownOpener(this); 1227
1228 // No action is necessary if the opener has already been cleared.
1229 if (!frame_tree_node_->opener())
1230 return;
1231
1232 // Clear our opener so that future cross-process navigations don't have an
1233 // opener assigned.
1234 frame_tree_node_->SetOpener(nullptr);
1235
1236 // 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.
1237 // in case we go back to them, or if another window in those processes tries
1238 // to access window.opener.
1239 frame_tree_node_->render_manager()->DidDisownOpener(this);
1228 } 1240 }
1229 1241
1230 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) { 1242 void RenderFrameHostImpl::OnDidChangeName(const std::string& name) {
1231 frame_tree_node()->SetFrameName(name); 1243 frame_tree_node()->SetFrameName(name);
1232 delegate_->DidChangeName(this, name); 1244 delegate_->DidChangeName(this, name);
1233 } 1245 }
1234 1246
1235 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) { 1247 void RenderFrameHostImpl::OnDidAssignPageId(int32 page_id) {
1236 // Update the RVH's current page ID so that future IPCs from the renderer 1248 // Update the RVH's current page ID so that future IPCs from the renderer
1237 // correspond to the new page. 1249 // correspond to the new page.
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 // We may be returning to an existing NavigationEntry that had been granted 2083 // We may be returning to an existing NavigationEntry that had been granted
2072 // file access. If this is a different process, we will need to grant the 2084 // file access. If this is a different process, we will need to grant the
2073 // access again. The files listed in the page state are validated when they 2085 // access again. The files listed in the page state are validated when they
2074 // are received from the renderer to prevent abuse. 2086 // are received from the renderer to prevent abuse.
2075 if (request_params.page_state.IsValid()) { 2087 if (request_params.page_state.IsValid()) {
2076 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); 2088 render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
2077 } 2089 }
2078 } 2090 }
2079 2091
2080 } // namespace content 2092 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698