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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Extend tests, fix redirects. Non-PlzNavigate version still broken. Created 3 years, 9 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::OnDidChangeCollapsedByClientState(bool collapsed) {
998 DCHECK(frame_tree_node_->parent());
999 SiteInstance* parent_site_instance =
1000 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
1001
1002 // There will be no proxy to represent the pending or speculative RFHs in the
1003 // parent's SiteInstance until the provisional load is committed, but the old
1004 // RFH is not swapped out before that happens either, so we can talk to the
1005 // FrameOwner in the parent via the child's current RenderFrame at any time.
1006 DCHECK(current_frame_host());
1007 if (current_frame_host()->GetSiteInstance() == parent_site_instance) {
1008 current_frame_host()->Send(
1009 new FrameMsg_Collapse(current_frame_host()->GetRoutingID(), collapsed));
1010 } else {
1011 RenderFrameProxyHost* proxy_to_parent = GetProxyToParent();
1012 proxy_to_parent->Send(
1013 new FrameMsg_Collapse(proxy_to_parent->GetRoutingID(), collapsed));
1014 }
1015 }
1016
997 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties( 1017 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties(
998 const FrameOwnerProperties& properties) { 1018 const FrameOwnerProperties& properties) {
999 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 1019 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
1000 return; 1020 return;
1001 1021
1002 // FrameOwnerProperties exist only for frames that have a parent. 1022 // FrameOwnerProperties exist only for frames that have a parent.
1003 CHECK(frame_tree_node_->parent()); 1023 CHECK(frame_tree_node_->parent());
1004 SiteInstance* parent_instance = 1024 SiteInstance* parent_instance =
1005 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); 1025 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
1006 1026
(...skipping 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after
2814 resolved_url)) { 2834 resolved_url)) {
2815 DCHECK(!dest_instance || 2835 DCHECK(!dest_instance ||
2816 dest_instance == render_frame_host_->GetSiteInstance()); 2836 dest_instance == render_frame_host_->GetSiteInstance());
2817 return false; 2837 return false;
2818 } 2838 }
2819 2839
2820 return true; 2840 return true;
2821 } 2841 }
2822 2842
2823 } // namespace content 2843 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698