| OLD | NEW |
| 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 <utility> | 10 #include <utility> |
| (...skipping 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 new FrameMsg_DidStartLoading(pair.second->GetRoutingID())); | 948 new FrameMsg_DidStartLoading(pair.second->GetRoutingID())); |
| 949 } | 949 } |
| 950 } | 950 } |
| 951 | 951 |
| 952 void RenderFrameHostManager::OnDidStopLoading() { | 952 void RenderFrameHostManager::OnDidStopLoading() { |
| 953 for (const auto& pair : proxy_hosts_) { | 953 for (const auto& pair : proxy_hosts_) { |
| 954 pair.second->Send(new FrameMsg_DidStopLoading(pair.second->GetRoutingID())); | 954 pair.second->Send(new FrameMsg_DidStopLoading(pair.second->GetRoutingID())); |
| 955 } | 955 } |
| 956 } | 956 } |
| 957 | 957 |
| 958 void RenderFrameHostManager::OnDidUpdateName(const std::string& name) { | 958 void RenderFrameHostManager::OnDidUpdateName(const std::string& name, |
| 959 const std::string& unique_name) { |
| 959 // The window.name message may be sent outside of --site-per-process when | 960 // The window.name message may be sent outside of --site-per-process when |
| 960 // report_frame_name_changes renderer preference is set (used by | 961 // report_frame_name_changes renderer preference is set (used by |
| 961 // WebView). Don't send the update to proxies in those cases. | 962 // WebView). Don't send the update to proxies in those cases. |
| 962 // TODO(nick,nasko): Should this be IsSwappedOutStateForbidden, to match | 963 // TODO(nick,nasko): Should this be IsSwappedOutStateForbidden, to match |
| 963 // OnDidUpdateOrigin? | 964 // OnDidUpdateOrigin? |
| 964 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 965 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 965 return; | 966 return; |
| 966 | 967 |
| 967 for (const auto& pair : proxy_hosts_) { | 968 for (const auto& pair : proxy_hosts_) { |
| 968 pair.second->Send( | 969 pair.second->Send(new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), |
| 969 new FrameMsg_DidUpdateName(pair.second->GetRoutingID(), name)); | 970 name, unique_name)); |
| 970 } | 971 } |
| 971 } | 972 } |
| 972 | 973 |
| 973 void RenderFrameHostManager::OnEnforceStrictMixedContentChecking( | 974 void RenderFrameHostManager::OnEnforceStrictMixedContentChecking( |
| 974 bool should_enforce) { | 975 bool should_enforce) { |
| 975 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) | 976 if (!SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
| 976 return; | 977 return; |
| 977 | 978 |
| 978 for (const auto& pair : proxy_hosts_) { | 979 for (const auto& pair : proxy_hosts_) { |
| 979 pair.second->Send(new FrameMsg_EnforceStrictMixedContentChecking( | 980 pair.second->Send(new FrameMsg_EnforceStrictMixedContentChecking( |
| (...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1809 // Swap the outer WebContents's frame with the proxy to inner WebContents. | 1810 // Swap the outer WebContents's frame with the proxy to inner WebContents. |
| 1810 // | 1811 // |
| 1811 // We are in the outer WebContents, and its FrameTree would never see | 1812 // We are in the outer WebContents, and its FrameTree would never see |
| 1812 // a load start for any of its inner WebContents. Eventually, that also makes | 1813 // a load start for any of its inner WebContents. Eventually, that also makes |
| 1813 // the FrameTree never see the matching load stop. Therefore, we always pass | 1814 // the FrameTree never see the matching load stop. Therefore, we always pass |
| 1814 // false to |is_loading| below. | 1815 // false to |is_loading| below. |
| 1815 // TODO(lazyboy): This |is_loading| behavior might not be what we want, | 1816 // TODO(lazyboy): This |is_loading| behavior might not be what we want, |
| 1816 // investigate and fix. | 1817 // investigate and fix. |
| 1817 render_frame_host->Send(new FrameMsg_SwapOut( | 1818 render_frame_host->Send(new FrameMsg_SwapOut( |
| 1818 render_frame_host->GetRoutingID(), proxy->GetRoutingID(), | 1819 render_frame_host->GetRoutingID(), proxy->GetRoutingID(), |
| 1819 false /* is_loading */, FrameReplicationState())); | 1820 false /* is_loading */, |
| 1821 render_frame_host->frame_tree_node()->current_replication_state())); |
| 1820 proxy->set_render_frame_proxy_created(true); | 1822 proxy->set_render_frame_proxy_created(true); |
| 1821 } | 1823 } |
| 1822 | 1824 |
| 1823 void RenderFrameHostManager::SetRWHViewForInnerContents( | 1825 void RenderFrameHostManager::SetRWHViewForInnerContents( |
| 1824 RenderWidgetHostView* child_rwhv) { | 1826 RenderWidgetHostView* child_rwhv) { |
| 1825 DCHECK(ForInnerDelegate() && frame_tree_node_->IsMainFrame()); | 1827 DCHECK(ForInnerDelegate() && frame_tree_node_->IsMainFrame()); |
| 1826 GetProxyToOuterDelegate()->SetChildRWHView(child_rwhv); | 1828 GetProxyToOuterDelegate()->SetChildRWHView(child_rwhv); |
| 1827 } | 1829 } |
| 1828 | 1830 |
| 1829 bool RenderFrameHostManager::InitRenderView( | 1831 bool RenderFrameHostManager::InitRenderView( |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2507 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2509 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
| 2508 if (!frame_tree_node_->opener()) | 2510 if (!frame_tree_node_->opener()) |
| 2509 return MSG_ROUTING_NONE; | 2511 return MSG_ROUTING_NONE; |
| 2510 | 2512 |
| 2511 return frame_tree_node_->opener() | 2513 return frame_tree_node_->opener() |
| 2512 ->render_manager() | 2514 ->render_manager() |
| 2513 ->GetRoutingIdForSiteInstance(instance); | 2515 ->GetRoutingIdForSiteInstance(instance); |
| 2514 } | 2516 } |
| 2515 | 2517 |
| 2516 } // namespace content | 2518 } // namespace content |
| OLD | NEW |