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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Rebase. Created 3 years, 10 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 blink::WebInsecureRequestPolicy policy) { 987 blink::WebInsecureRequestPolicy policy) {
988 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 988 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
989 return; 989 return;
990 990
991 for (const auto& pair : proxy_hosts_) { 991 for (const auto& pair : proxy_hosts_) {
992 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy( 992 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy(
993 pair.second->GetRoutingID(), policy)); 993 pair.second->GetRoutingID(), policy));
994 } 994 }
995 } 995 }
996 996
997 void RenderFrameHostManager::OnDidUpdateFrameOwnerCollapsedState(
998 bool collapsed) {
999 DCHECK(frame_tree_node_->parent());
1000 SiteInstance* parent_site_instance =
1001 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
1002
1003 // There will be no proxy to represent the pending or speculative RFHs in the
1004 // parent's site instance until the provisional load is committed, but the old
1005 // RFH is not swapped out before that happens either, so we can talk to the
1006 // FrameOwner in the parent via the child's current RenderFrame at any time.
1007 DCHECK(current_frame_host());
1008 if (current_frame_host()->GetSiteInstance() == parent_site_instance) {
1009 current_frame_host()->Send(new FrameMsg_CollapseFrameOwner(
1010 current_frame_host()->GetRoutingID(), collapsed));
1011 } else {
1012 RenderFrameProxyHost* proxy_to_parent = GetProxyToParent();
1013 proxy_to_parent->Send(new FrameMsg_CollapseFrameOwner(
1014 proxy_to_parent->GetRoutingID(), collapsed));
1015 }
1016 }
1017
997 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties( 1018 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties(
998 const FrameOwnerProperties& properties) { 1019 const FrameOwnerProperties& properties) {
999 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 1020 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
1000 return; 1021 return;
1001 1022
1002 // FrameOwnerProperties exist only for frames that have a parent. 1023 // FrameOwnerProperties exist only for frames that have a parent.
1003 CHECK(frame_tree_node_->parent()); 1024 CHECK(frame_tree_node_->parent());
1004 SiteInstance* parent_instance = 1025 SiteInstance* parent_instance =
1005 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); 1026 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
1006 1027
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 resolved_url)) { 2835 resolved_url)) {
2815 DCHECK(!dest_instance || 2836 DCHECK(!dest_instance ||
2816 dest_instance == render_frame_host_->GetSiteInstance()); 2837 dest_instance == render_frame_host_->GetSiteInstance());
2817 return false; 2838 return false;
2818 } 2839 }
2819 2840
2820 return true; 2841 return true;
2821 } 2842 }
2822 2843
2823 } // namespace content 2844 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698