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

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

Issue 2146803004: Create a content::FrameOwnerProperties struct for IPC transport of WebFrameOwnerProperties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Transport Created 4 years, 5 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 <utility> 10 #include <utility>
(...skipping 18 matching lines...) Expand all
29 #include "content/browser/frame_host/navigator.h" 29 #include "content/browser/frame_host/navigator.h"
30 #include "content/browser/frame_host/render_frame_host_factory.h" 30 #include "content/browser/frame_host/render_frame_host_factory.h"
31 #include "content/browser/frame_host/render_frame_host_impl.h" 31 #include "content/browser/frame_host/render_frame_host_impl.h"
32 #include "content/browser/frame_host/render_frame_proxy_host.h" 32 #include "content/browser/frame_host/render_frame_proxy_host.h"
33 #include "content/browser/renderer_host/render_process_host_impl.h" 33 #include "content/browser/renderer_host/render_process_host_impl.h"
34 #include "content/browser/renderer_host/render_view_host_factory.h" 34 #include "content/browser/renderer_host/render_view_host_factory.h"
35 #include "content/browser/renderer_host/render_view_host_impl.h" 35 #include "content/browser/renderer_host/render_view_host_impl.h"
36 #include "content/browser/site_instance_impl.h" 36 #include "content/browser/site_instance_impl.h"
37 #include "content/browser/webui/web_ui_controller_factory_registry.h" 37 #include "content/browser/webui/web_ui_controller_factory_registry.h"
38 #include "content/common/frame_messages.h" 38 #include "content/common/frame_messages.h"
39 #include "content/common/frame_owner_properties.h"
39 #include "content/common/site_isolation_policy.h" 40 #include "content/common/site_isolation_policy.h"
40 #include "content/common/view_messages.h" 41 #include "content/common/view_messages.h"
41 #include "content/public/browser/content_browser_client.h" 42 #include "content/public/browser/content_browser_client.h"
42 #include "content/public/browser/render_process_host_observer.h" 43 #include "content/public/browser/render_process_host_observer.h"
43 #include "content/public/browser/render_widget_host_iterator.h" 44 #include "content/public/browser/render_widget_host_iterator.h"
44 #include "content/public/browser/render_widget_host_view.h" 45 #include "content/public/browser/render_widget_host_view.h"
45 #include "content/public/browser/user_metrics.h" 46 #include "content/public/browser/user_metrics.h"
46 #include "content/public/common/browser_plugin_guest_mode.h" 47 #include "content/public/common/browser_plugin_guest_mode.h"
47 #include "content/public/common/browser_side_navigation_policy.h" 48 #include "content/public/common/browser_side_navigation_policy.h"
48 #include "content/public/common/content_switches.h" 49 #include "content/public/common/content_switches.h"
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 return; 983 return;
983 984
984 // WebFrameOwnerProperties exist only for frames that have a parent. 985 // WebFrameOwnerProperties exist only for frames that have a parent.
985 CHECK(frame_tree_node_->parent()); 986 CHECK(frame_tree_node_->parent());
986 SiteInstance* parent_instance = 987 SiteInstance* parent_instance =
987 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); 988 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
988 989
989 // Notify the RenderFrame if it lives in a different process from its parent. 990 // Notify the RenderFrame if it lives in a different process from its parent.
990 if (render_frame_host_->GetSiteInstance() != parent_instance) { 991 if (render_frame_host_->GetSiteInstance() != parent_instance) {
991 render_frame_host_->Send(new FrameMsg_SetFrameOwnerProperties( 992 render_frame_host_->Send(new FrameMsg_SetFrameOwnerProperties(
992 render_frame_host_->GetRoutingID(), properties)); 993 render_frame_host_->GetRoutingID(), FrameOwnerProperties(properties)));
993 } 994 }
994 995
995 // Notify this frame's proxies if they live in a different process from its 996 // Notify this frame's proxies if they live in a different process from its
996 // parent. This is only currently needed for the allowFullscreen property, 997 // parent. This is only currently needed for the allowFullscreen property,
997 // since that can be queried on RemoteFrame ancestors. 998 // since that can be queried on RemoteFrame ancestors.
998 // 999 //
999 // TODO(alexmos): It would be sufficient to only send this update to proxies 1000 // TODO(alexmos): It would be sufficient to only send this update to proxies
1000 // in the current FrameTree. 1001 // in the current FrameTree.
1001 for (const auto& pair : proxy_hosts_) { 1002 for (const auto& pair : proxy_hosts_) {
1002 if (pair.second->GetSiteInstance() != parent_instance) { 1003 if (pair.second->GetSiteInstance() != parent_instance) {
1003 pair.second->Send(new FrameMsg_SetFrameOwnerProperties( 1004 pair.second->Send(new FrameMsg_SetFrameOwnerProperties(
1004 pair.second->GetRoutingID(), properties)); 1005 pair.second->GetRoutingID(), FrameOwnerProperties(properties)));
1005 } 1006 }
1006 } 1007 }
1007 } 1008 }
1008 1009
1009 void RenderFrameHostManager::OnDidUpdateOrigin( 1010 void RenderFrameHostManager::OnDidUpdateOrigin(
1010 const url::Origin& origin, 1011 const url::Origin& origin,
1011 bool is_potentially_trustworthy_unique_origin) { 1012 bool is_potentially_trustworthy_unique_origin) {
1012 for (const auto& pair : proxy_hosts_) { 1013 for (const auto& pair : proxy_hosts_) {
1013 pair.second->Send( 1014 pair.second->Send(
1014 new FrameMsg_DidUpdateOrigin(pair.second->GetRoutingID(), origin, 1015 new FrameMsg_DidUpdateOrigin(pair.second->GetRoutingID(), origin,
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
2603 resolved_url)) { 2604 resolved_url)) {
2604 DCHECK(!dest_instance || 2605 DCHECK(!dest_instance ||
2605 dest_instance == render_frame_host_->GetSiteInstance()); 2606 dest_instance == render_frame_host_->GetSiteInstance());
2606 return false; 2607 return false;
2607 } 2608 }
2608 2609
2609 return true; 2610 return true;
2610 } 2611 }
2611 2612
2612 } // namespace content 2613 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698