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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.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_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "content/browser/renderer_host/render_view_host_delegate.h" 47 #include "content/browser/renderer_host/render_view_host_delegate.h"
48 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 48 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
49 #include "content/browser/renderer_host/render_view_host_impl.h" 49 #include "content/browser/renderer_host/render_view_host_impl.h"
50 #include "content/browser/renderer_host/render_widget_host_delegate.h" 50 #include "content/browser/renderer_host/render_widget_host_delegate.h"
51 #include "content/browser/renderer_host/render_widget_host_impl.h" 51 #include "content/browser/renderer_host/render_widget_host_impl.h"
52 #include "content/browser/renderer_host/render_widget_host_view_base.h" 52 #include "content/browser/renderer_host/render_widget_host_view_base.h"
53 #include "content/browser/wake_lock/wake_lock_service_context.h" 53 #include "content/browser/wake_lock/wake_lock_service_context.h"
54 #include "content/browser/webui/web_ui_controller_factory_registry.h" 54 #include "content/browser/webui/web_ui_controller_factory_registry.h"
55 #include "content/common/accessibility_messages.h" 55 #include "content/common/accessibility_messages.h"
56 #include "content/common/frame_messages.h" 56 #include "content/common/frame_messages.h"
57 #include "content/common/frame_owner_properties.h"
57 #include "content/common/input_messages.h" 58 #include "content/common/input_messages.h"
58 #include "content/common/inter_process_time_ticks_converter.h" 59 #include "content/common/inter_process_time_ticks_converter.h"
59 #include "content/common/navigation_params.h" 60 #include "content/common/navigation_params.h"
60 #include "content/common/site_isolation_policy.h" 61 #include "content/common/site_isolation_policy.h"
61 #include "content/common/swapped_out_messages.h" 62 #include "content/common/swapped_out_messages.h"
62 #include "content/public/browser/ax_event_notification_details.h" 63 #include "content/public/browser/ax_event_notification_details.h"
63 #include "content/public/browser/browser_accessibility_state.h" 64 #include "content/public/browser/browser_accessibility_state.h"
64 #include "content/public/browser/browser_context.h" 65 #include "content/public/browser/browser_context.h"
65 #include "content/public/browser/browser_plugin_guest_manager.h" 66 #include "content/public/browser/browser_plugin_guest_manager.h"
66 #include "content/public/browser/browser_thread.h" 67 #include "content/public/browser/browser_thread.h"
67 #include "content/public/browser/content_browser_client.h" 68 #include "content/public/browser/content_browser_client.h"
68 #include "content/public/browser/permission_manager.h" 69 #include "content/public/browser/permission_manager.h"
69 #include "content/public/browser/permission_type.h" 70 #include "content/public/browser/permission_type.h"
70 #include "content/public/browser/render_process_host.h" 71 #include "content/public/browser/render_process_host.h"
71 #include "content/public/browser/render_widget_host_view.h" 72 #include "content/public/browser/render_widget_host_view.h"
72 #include "content/public/browser/storage_partition.h" 73 #include "content/public/browser/storage_partition.h"
73 #include "content/public/browser/stream_handle.h" 74 #include "content/public/browser/stream_handle.h"
74 #include "content/public/browser/user_metrics.h" 75 #include "content/public/browser/user_metrics.h"
75 #include "content/public/common/browser_side_navigation_policy.h" 76 #include "content/public/common/browser_side_navigation_policy.h"
76 #include "content/public/common/content_constants.h" 77 #include "content/public/common/content_constants.h"
77 #include "content/public/common/content_switches.h" 78 #include "content/public/common/content_switches.h"
78 #include "content/public/common/file_chooser_file_info.h" 79 #include "content/public/common/file_chooser_file_info.h"
79 #include "content/public/common/file_chooser_params.h" 80 #include "content/public/common/file_chooser_params.h"
80 #include "content/public/common/isolated_world_ids.h" 81 #include "content/public/common/isolated_world_ids.h"
81 #include "content/public/common/url_constants.h" 82 #include "content/public/common/url_constants.h"
82 #include "content/public/common/url_utils.h" 83 #include "content/public/common/url_utils.h"
83 #include "device/vibration/vibration_manager_impl.h" 84 #include "device/vibration/vibration_manager_impl.h"
84 #include "services/shell/public/cpp/interface_provider.h" 85 #include "services/shell/public/cpp/interface_provider.h"
86 #include "third_party/WebKit/public/web/WebFrameOwnerProperties.h"
85 #include "ui/accessibility/ax_tree.h" 87 #include "ui/accessibility/ax_tree.h"
86 #include "ui/accessibility/ax_tree_update.h" 88 #include "ui/accessibility/ax_tree_update.h"
87 #include "ui/gfx/geometry/quad_f.h" 89 #include "ui/gfx/geometry/quad_f.h"
88 #include "url/gurl.h" 90 #include "url/gurl.h"
89 91
90 #if defined(OS_ANDROID) 92 #if defined(OS_ANDROID)
91 #include "content/browser/mojo/service_registrar_android.h" 93 #include "content/browser/mojo/service_registrar_android.h"
92 #endif 94 #endif
93 95
94 #if defined(OS_MACOSX) 96 #if defined(OS_MACOSX)
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 803
802 // Normally, the replication state contains effective sandbox flags, 804 // Normally, the replication state contains effective sandbox flags,
803 // excluding flags that were updated but have not taken effect. However, a 805 // excluding flags that were updated but have not taken effect. However, a
804 // new RenderFrame should use the pending sandbox flags, since it is being 806 // new RenderFrame should use the pending sandbox flags, since it is being
805 // created as part of the navigation that will commit these flags. (I.e., the 807 // created as part of the navigation that will commit these flags. (I.e., the
806 // RenderFrame needs to know the flags to use when initializing the new 808 // RenderFrame needs to know the flags to use when initializing the new
807 // document once it commits). 809 // document once it commits).
808 params.replication_state.sandbox_flags = 810 params.replication_state.sandbox_flags =
809 frame_tree_node()->pending_sandbox_flags(); 811 frame_tree_node()->pending_sandbox_flags();
810 812
811 params.frame_owner_properties = frame_tree_node()->frame_owner_properties(); 813 params.frame_owner_properties =
814 FrameOwnerProperties(frame_tree_node()->frame_owner_properties());
812 815
813 if (render_widget_host_) { 816 if (render_widget_host_) {
814 params.widget_params.routing_id = render_widget_host_->GetRoutingID(); 817 params.widget_params.routing_id = render_widget_host_->GetRoutingID();
815 params.widget_params.hidden = render_widget_host_->is_hidden(); 818 params.widget_params.hidden = render_widget_host_->is_hidden();
816 } else { 819 } else {
817 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in 820 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in
818 // the renderer process. 821 // the renderer process.
819 params.widget_params.routing_id = MSG_ROUTING_NONE; 822 params.widget_params.routing_id = MSG_ROUTING_NONE;
820 params.widget_params.hidden = true; 823 params.widget_params.hidden = true;
821 } 824 }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 // navigates and the new sandbox flags take effect. 1654 // navigates and the new sandbox flags take effect.
1652 RenderFrameHost* child_rfh = child->current_frame_host(); 1655 RenderFrameHost* child_rfh = child->current_frame_host();
1653 if (child_rfh->GetSiteInstance() != GetSiteInstance()) { 1656 if (child_rfh->GetSiteInstance() != GetSiteInstance()) {
1654 child_rfh->Send( 1657 child_rfh->Send(
1655 new FrameMsg_DidUpdateSandboxFlags(child_rfh->GetRoutingID(), flags)); 1658 new FrameMsg_DidUpdateSandboxFlags(child_rfh->GetRoutingID(), flags));
1656 } 1659 }
1657 } 1660 }
1658 1661
1659 void RenderFrameHostImpl::OnDidChangeFrameOwnerProperties( 1662 void RenderFrameHostImpl::OnDidChangeFrameOwnerProperties(
1660 int32_t frame_routing_id, 1663 int32_t frame_routing_id,
1661 const blink::WebFrameOwnerProperties& properties) { 1664 const FrameOwnerProperties& properties) {
1662 FrameTreeNode* child = FindAndVerifyChild( 1665 FrameTreeNode* child = FindAndVerifyChild(
1663 frame_routing_id, bad_message::RFH_OWNER_PROPERTY); 1666 frame_routing_id, bad_message::RFH_OWNER_PROPERTY);
1664 if (!child) 1667 if (!child)
1665 return; 1668 return;
1666 1669
1667 child->set_frame_owner_properties(properties); 1670 blink::WebFrameOwnerProperties web_properties =
1671 properties.ToWebFrameOwnerProperties();
nasko 2016/07/18 21:59:15 Can we avoid this conversion? Why not pass through
raymes 2016/07/19 00:22:00 I've changed this to do that in https://codereview
1668 1672
1669 child->render_manager()->OnDidUpdateFrameOwnerProperties(properties); 1673 child->set_frame_owner_properties(web_properties);
1674
1675 child->render_manager()->OnDidUpdateFrameOwnerProperties(web_properties);
1670 } 1676 }
1671 1677
1672 void RenderFrameHostImpl::OnUpdateTitle( 1678 void RenderFrameHostImpl::OnUpdateTitle(
1673 const base::string16& title, 1679 const base::string16& title,
1674 blink::WebTextDirection title_direction) { 1680 blink::WebTextDirection title_direction) {
1675 // This message should only be sent for top-level frames. 1681 // This message should only be sent for top-level frames.
1676 if (frame_tree_node_->parent()) 1682 if (frame_tree_node_->parent())
1677 return; 1683 return;
1678 1684
1679 if (title.length() > kMaxTitleChars) { 1685 if (title.length() > kMaxTitleChars) {
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2958 // handler after it's destroyed so it can't run after the RFHI is destroyed. 2964 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2959 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2965 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2960 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2966 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2961 } 2967 }
2962 2968
2963 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2969 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2964 web_bluetooth_service_.reset(); 2970 web_bluetooth_service_.reset();
2965 } 2971 }
2966 2972
2967 } // namespace content 2973 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698