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

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

Issue 2632633006: Implement NavigationThrottle::BLOCK_REQUEST_AND_COLLAPSE. (Closed)
Patch Set: ... and without breaking stuff. 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 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 blink::WebInsecureRequestPolicy policy) { 923 blink::WebInsecureRequestPolicy policy) {
924 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 924 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
925 return; 925 return;
926 926
927 for (const auto& pair : proxy_hosts_) { 927 for (const auto& pair : proxy_hosts_) {
928 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy( 928 pair.second->Send(new FrameMsg_EnforceInsecureRequestPolicy(
929 pair.second->GetRoutingID(), policy)); 929 pair.second->GetRoutingID(), policy));
930 } 930 }
931 } 931 }
932 932
933 void RenderFrameHostManager::OnDidChangeCollapsedState(bool collapsed) {
934 DCHECK(frame_tree_node_->parent());
935 SiteInstance* parent_site_instance =
936 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
937
938 // There will be no proxy to represent the pending or speculative RFHs in the
939 // parent's SiteInstance until the provisional load is committed, but the old
940 // RFH is not swapped out before that happens either, so we can talk to the
941 // FrameOwner in the parent via the child's current RenderFrame at any time.
942 DCHECK(current_frame_host());
943 if (current_frame_host()->GetSiteInstance() == parent_site_instance) {
944 current_frame_host()->Send(
945 new FrameMsg_Collapse(current_frame_host()->GetRoutingID(), collapsed));
946 } else {
947 RenderFrameProxyHost* proxy_to_parent =
948 GetRenderFrameProxyHost(parent_site_instance);
949 proxy_to_parent->Send(
950 new FrameMsg_Collapse(proxy_to_parent->GetRoutingID(), collapsed));
951 }
952 }
953
933 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties( 954 void RenderFrameHostManager::OnDidUpdateFrameOwnerProperties(
934 const FrameOwnerProperties& properties) { 955 const FrameOwnerProperties& properties) {
935 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) 956 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible())
936 return; 957 return;
937 958
938 // FrameOwnerProperties exist only for frames that have a parent. 959 // FrameOwnerProperties exist only for frames that have a parent.
939 CHECK(frame_tree_node_->parent()); 960 CHECK(frame_tree_node_->parent());
940 SiteInstance* parent_instance = 961 SiteInstance* parent_instance =
941 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); 962 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
942 963
(...skipping 1865 matching lines...) Expand 10 before | Expand all | Expand 10 after
2808 delegate_->IsHidden()) { 2829 delegate_->IsHidden()) {
2809 if (delegate_->IsHidden()) { 2830 if (delegate_->IsHidden()) {
2810 render_frame_host_->GetView()->Hide(); 2831 render_frame_host_->GetView()->Hide();
2811 } else { 2832 } else {
2812 render_frame_host_->GetView()->Show(); 2833 render_frame_host_->GetView()->Show();
2813 } 2834 }
2814 } 2835 }
2815 } 2836 }
2816 2837
2817 } // namespace content 2838 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698