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

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"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 802
802 // Normally, the replication state contains effective sandbox flags, 803 // Normally, the replication state contains effective sandbox flags,
803 // excluding flags that were updated but have not taken effect. However, a 804 // 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 805 // 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 806 // 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 807 // RenderFrame needs to know the flags to use when initializing the new
807 // document once it commits). 808 // document once it commits).
808 params.replication_state.sandbox_flags = 809 params.replication_state.sandbox_flags =
809 frame_tree_node()->pending_sandbox_flags(); 810 frame_tree_node()->pending_sandbox_flags();
810 811
811 params.frame_owner_properties = frame_tree_node()->frame_owner_properties(); 812 params.frame_owner_properties =
813 FrameOwnerProperties(frame_tree_node()->frame_owner_properties());
812 814
813 if (render_widget_host_) { 815 if (render_widget_host_) {
814 params.widget_params.routing_id = render_widget_host_->GetRoutingID(); 816 params.widget_params.routing_id = render_widget_host_->GetRoutingID();
815 params.widget_params.hidden = render_widget_host_->is_hidden(); 817 params.widget_params.hidden = render_widget_host_->is_hidden();
816 } else { 818 } else {
817 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in 819 // MSG_ROUTING_NONE will prevent a new RenderWidget from being created in
818 // the renderer process. 820 // the renderer process.
819 params.widget_params.routing_id = MSG_ROUTING_NONE; 821 params.widget_params.routing_id = MSG_ROUTING_NONE;
820 params.widget_params.hidden = true; 822 params.widget_params.hidden = true;
821 } 823 }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 // navigates and the new sandbox flags take effect. 1653 // navigates and the new sandbox flags take effect.
1652 RenderFrameHost* child_rfh = child->current_frame_host(); 1654 RenderFrameHost* child_rfh = child->current_frame_host();
1653 if (child_rfh->GetSiteInstance() != GetSiteInstance()) { 1655 if (child_rfh->GetSiteInstance() != GetSiteInstance()) {
1654 child_rfh->Send( 1656 child_rfh->Send(
1655 new FrameMsg_DidUpdateSandboxFlags(child_rfh->GetRoutingID(), flags)); 1657 new FrameMsg_DidUpdateSandboxFlags(child_rfh->GetRoutingID(), flags));
1656 } 1658 }
1657 } 1659 }
1658 1660
1659 void RenderFrameHostImpl::OnDidChangeFrameOwnerProperties( 1661 void RenderFrameHostImpl::OnDidChangeFrameOwnerProperties(
1660 int32_t frame_routing_id, 1662 int32_t frame_routing_id,
1661 const blink::WebFrameOwnerProperties& properties) { 1663 const FrameOwnerProperties& properties) {
1662 FrameTreeNode* child = FindAndVerifyChild( 1664 FrameTreeNode* child = FindAndVerifyChild(
1663 frame_routing_id, bad_message::RFH_OWNER_PROPERTY); 1665 frame_routing_id, bad_message::RFH_OWNER_PROPERTY);
1664 if (!child) 1666 if (!child)
1665 return; 1667 return;
1666 1668
1667 child->set_frame_owner_properties(properties); 1669 blink::WebFrameOwnerProperties web_properties =
1670 properties.ToWebFrameOwnerProperties();
1668 1671
1669 child->render_manager()->OnDidUpdateFrameOwnerProperties(properties); 1672 child->set_frame_owner_properties(web_properties);
1673
1674 child->render_manager()->OnDidUpdateFrameOwnerProperties(web_properties);
1670 } 1675 }
1671 1676
1672 void RenderFrameHostImpl::OnUpdateTitle( 1677 void RenderFrameHostImpl::OnUpdateTitle(
1673 const base::string16& title, 1678 const base::string16& title,
1674 blink::WebTextDirection title_direction) { 1679 blink::WebTextDirection title_direction) {
1675 // This message should only be sent for top-level frames. 1680 // This message should only be sent for top-level frames.
1676 if (frame_tree_node_->parent()) 1681 if (frame_tree_node_->parent())
1677 return; 1682 return;
1678 1683
1679 if (title.length() > kMaxTitleChars) { 1684 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. 2963 // handler after it's destroyed so it can't run after the RFHI is destroyed.
2959 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 2964 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
2960 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 2965 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
2961 } 2966 }
2962 2967
2963 void RenderFrameHostImpl::DeleteWebBluetoothService() { 2968 void RenderFrameHostImpl::DeleteWebBluetoothService() {
2964 web_bluetooth_service_.reset(); 2969 web_bluetooth_service_.reset();
2965 } 2970 }
2966 2971
2967 } // namespace content 2972 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698