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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Addressed comments, made redirect response PlzNavigate-only. Created 3 years, 8 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_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 5ae522b0a7b448c1cf8ab395d06544110703e08e..b61d6a1b1fc134f31279c83113800c8e9ecf3421 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -930,6 +930,26 @@ void RenderFrameHostManager::OnEnforceInsecureRequestPolicy(
}
}
+void RenderFrameHostManager::OnDidChangeCollapsedState(bool collapsed) {
+ DCHECK(frame_tree_node_->parent());
+ SiteInstance* parent_site_instance =
+ frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
+
+ // There will be no proxy to represent the pending or speculative RFHs in the
+ // parent's SiteInstance until the provisional load is committed, but the old
+ // RFH is not swapped out before that happens either, so we can talk to the
+ // FrameOwner in the parent via the child's current RenderFrame at any time.
+ DCHECK(current_frame_host());
+ if (current_frame_host()->GetSiteInstance() == parent_site_instance) {
+ current_frame_host()->Send(
+ new FrameMsg_Collapse(current_frame_host()->GetRoutingID(), collapsed));
+ } else {
+ RenderFrameProxyHost* proxy_to_parent = GetProxyToParent();
alexmos 2017/04/11 06:00:29 optional: you could just use GetRenderFrameProxyHo
engedy 2017/04/11 08:06:17 Nice, done!
+ proxy_to_parent->Send(
+ new FrameMsg_Collapse(proxy_to_parent->GetRoutingID(), collapsed));
+ }
+}
+
void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties(
const FrameOwnerProperties& properties) {
if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())

Powered by Google App Engine
This is Rietveld 408576698