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

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

Issue 1309043003: Handle frame openers in the same FrameTree when navigating subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opener-cycle-detection
Patch Set: Add comment for the DCHECK Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_proxy_host.h" 5 #include "content/browser/frame_host/render_frame_proxy_host.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "content/browser/bad_message.h" 8 #include "content/browser/bad_message.h"
9 #include "content/browser/frame_host/cross_process_frame_connector.h" 9 #include "content/browser/frame_host/cross_process_frame_connector.h"
10 #include "content/browser/frame_host/frame_tree.h" 10 #include "content/browser/frame_host/frame_tree.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 render_frame_proxy_created_ = true; 196 render_frame_proxy_created_ = true;
197 return true; 197 return true;
198 } 198 }
199 199
200 void RenderFrameProxyHost::UpdateOpener() { 200 void RenderFrameProxyHost::UpdateOpener() {
201 // Another frame in this proxy's SiteInstance may reach the new opener by 201 // Another frame in this proxy's SiteInstance may reach the new opener by
202 // first reaching this proxy and then referencing its window.opener. Ensure 202 // first reaching this proxy and then referencing its window.opener. Ensure
203 // the new opener's proxy exists in this case. 203 // the new opener's proxy exists in this case.
204 if (frame_tree_node_->opener()) { 204 if (frame_tree_node_->opener()) {
205 frame_tree_node_->opener()->render_manager()->CreateOpenerProxies( 205 frame_tree_node_->opener()->render_manager()->CreateOpenerProxies(
206 GetSiteInstance()); 206 GetSiteInstance(), frame_tree_node_);
207 } 207 }
208 208
209 int opener_routing_id = 209 int opener_routing_id =
210 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance()); 210 frame_tree_node_->render_manager()->GetOpenerRoutingID(GetSiteInstance());
211 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id)); 211 Send(new FrameMsg_UpdateOpener(GetRoutingID(), opener_routing_id));
212 } 212 }
213 213
214 void RenderFrameProxyHost::OnDetach() { 214 void RenderFrameProxyHost::OnDetach() {
215 if (frame_tree_node_->render_manager()->ForInnerDelegate()) { 215 if (frame_tree_node_->render_manager()->ForInnerDelegate()) {
216 // Only main frame proxy can detach for inner WebContents. 216 // Only main frame proxy can detach for inner WebContents.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params)); 308 new FrameMsg_PostMessageEvent(target_rfh->GetRoutingID(), new_params));
309 } 309 }
310 } 310 }
311 311
312 void RenderFrameProxyHost::OnDidChangeOpener(int32 opener_routing_id) { 312 void RenderFrameProxyHost::OnDidChangeOpener(int32 opener_routing_id) {
313 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id, 313 frame_tree_node_->render_manager()->DidChangeOpener(opener_routing_id,
314 GetSiteInstance()); 314 GetSiteInstance());
315 } 315 }
316 316
317 } // namespace content 317 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698