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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: Addressed comments from csharrison@. Created 3 years, 7 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 blink::WebInsecureRequestPolicy policy) { 942 blink::WebInsecureRequestPolicy policy) {
943 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 943 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
944 return; 944 return;
945 945
946 for (const auto& pair : proxy_hosts_) { 946 for (const auto& pair : proxy_hosts_) {
947 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy( 947 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy(
948 pair.second->GetRoutingID(), policy)); 948 pair.second->GetRoutingID(), policy));
949 } 949 }
950 } 950 }
951 951
952 void RenderFrameHostManager::OnDidChangeCollapsedState(bool collapsed) {
953 DCHECK(frame_tree_node_->parent());
954 SiteInstance* parent_site_instance =
955 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
956
957 // There will be no proxy to represent the pending or speculative RFHs in the
958 // parent's SiteInstance until the provisional load is committed, but the old
nasko 2017/05/03 16:58:30 nit: s/the provisional load/the navigation/
engedy 2017/05/05 08:23:57 Done.
959 // RFH is not swapped out before that happens either, so we can talk to the
960 // FrameOwner in the parent via the child's current RenderFrame at any time.
961 DCHECK(current_frame_host());
962 if (current_frame_host()->GetSiteInstance() == parent_site_instance) {
963 current_frame_host()->Send(
964 new FrameMsg_Collapse(current_frame_host()->GetRoutingID(), collapsed));
965 } else {
966 RenderFrameProxyHost* proxy_to_parent =
967 GetRenderFrameProxyHost(parent_site_instance);
968 proxy_to_parent->Send(
969 new FrameMsg_Collapse(proxy_to_parent->GetRoutingID(), collapsed));
970 }
971 }
972
952 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties( 973 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties(
953 const FrameOwnerProperties& properties) { 974 const FrameOwnerProperties& properties) {
954 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 975 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
955 return; 976 return;
956 977
957 // FrameOwnerProperties exist only for frames that have a parent. 978 // FrameOwnerProperties exist only for frames that have a parent.
958 CHECK(frame_tree_node_->parent()); 979 CHECK(frame_tree_node_->parent());
959 SiteInstance* parent_instance = 980 SiteInstance* parent_instance =
960 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); 981 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
961 982
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after
2854 delegate_->IsHidden()) { 2875 delegate_->IsHidden()) {
2855 if (delegate_->IsHidden()) { 2876 if (delegate_->IsHidden()) {
2856 render_frame_host_->GetView()->Hide(); 2877 render_frame_host_->GetView()->Hide();
2857 } else { 2878 } else {
2858 render_frame_host_->GetView()->Show(); 2879 render_frame_host_->GetView()->Show();
2859 } 2880 }
2860 } 2881 }
2861 } 2882 }
2862 2883
2863 } // namespace content 2884 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698