Commit cd37be9a authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert FrameMsg_DidUpdateVisualProperties to mojom interface

This CL converts FrameMsg_DidUpdateVisualProperties to RenderFrameProxy
and removes FrameMsg_DidUpdateVisualProperties message.

Bug: 1051146
Change-Id: I9d13f5d6d81a53910dffed3e28849b9556b5ba34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2061573Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#742429}
parent 0337870e
...@@ -416,8 +416,7 @@ bool CrossProcessFrameConnector::IsHidden() const { ...@@ -416,8 +416,7 @@ bool CrossProcessFrameConnector::IsHidden() const {
void CrossProcessFrameConnector::DidUpdateVisualProperties( void CrossProcessFrameConnector::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) { const cc::RenderFrameMetadata& metadata) {
frame_proxy_in_parent_renderer_->Send(new FrameMsg_DidUpdateVisualProperties( frame_proxy_in_parent_renderer_->DidUpdateVisualProperties(metadata);
frame_proxy_in_parent_renderer_->GetRoutingID(), metadata));
} }
void CrossProcessFrameConnector::SetVisibilityForChildViews( void CrossProcessFrameConnector::SetVisibilityForChildViews(
......
...@@ -457,6 +457,11 @@ void RenderFrameProxyHost::DisableAutoResize() { ...@@ -457,6 +457,11 @@ void RenderFrameProxyHost::DisableAutoResize() {
GetAssociatedRenderFrameProxy()->DisableAutoResize(); GetAssociatedRenderFrameProxy()->DisableAutoResize();
} }
void RenderFrameProxyHost::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
GetAssociatedRenderFrameProxy()->DidUpdateVisualProperties(metadata);
}
void RenderFrameProxyHost::OnRouteMessageEvent( void RenderFrameProxyHost::OnRouteMessageEvent(
const FrameMsg_PostMessage_Params& params) { const FrameMsg_PostMessage_Params& params) {
RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host(); RenderFrameHostImpl* target_rfh = frame_tree_node()->current_frame_host();
......
...@@ -169,6 +169,8 @@ class CONTENT_EXPORT RenderFrameProxyHost ...@@ -169,6 +169,8 @@ class CONTENT_EXPORT RenderFrameProxyHost
// renderer. // renderer.
void DisableAutoResize(); void DisableAutoResize();
void DidUpdateVisualProperties(const cc::RenderFrameMetadata& metadata);
blink::AssociatedInterfaceProvider* GetRemoteAssociatedInterfacesTesting(); blink::AssociatedInterfaceProvider* GetRemoteAssociatedInterfacesTesting();
bool IsInertForTesting(); bool IsInertForTesting();
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "base/optional.h" #include "base/optional.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "cc/input/touch_action.h" #include "cc/input/touch_action.h"
#include "cc/trees/render_frame_metadata.h"
#include "components/viz/common/surfaces/surface_id.h" #include "components/viz/common/surfaces/surface_id.h"
#include "components/viz/common/surfaces/surface_info.h" #include "components/viz/common/surfaces/surface_info.h"
#include "content/common/buildflags.h" #include "content/common/buildflags.h"
...@@ -233,17 +232,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::FrameVisualProperties) ...@@ -233,17 +232,6 @@ IPC_STRUCT_TRAITS_BEGIN(content::FrameVisualProperties)
IPC_STRUCT_TRAITS_MEMBER(local_surface_id_allocation) IPC_STRUCT_TRAITS_MEMBER(local_surface_id_allocation)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(cc::RenderFrameMetadata)
IPC_STRUCT_TRAITS_MEMBER(is_scroll_offset_at_top)
IPC_STRUCT_TRAITS_MEMBER(root_background_color)
IPC_STRUCT_TRAITS_MEMBER(root_scroll_offset)
IPC_STRUCT_TRAITS_MEMBER(selection)
IPC_STRUCT_TRAITS_MEMBER(is_mobile_optimized)
IPC_STRUCT_TRAITS_MEMBER(device_scale_factor)
IPC_STRUCT_TRAITS_MEMBER(viewport_size_in_pixels)
IPC_STRUCT_TRAITS_MEMBER(local_surface_id_allocation)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(blink::FramePolicy) IPC_STRUCT_TRAITS_BEGIN(blink::FramePolicy)
IPC_STRUCT_TRAITS_MEMBER(sandbox_flags) IPC_STRUCT_TRAITS_MEMBER(sandbox_flags)
IPC_STRUCT_TRAITS_MEMBER(container_policy) IPC_STRUCT_TRAITS_MEMBER(container_policy)
...@@ -607,11 +595,6 @@ IPC_MESSAGE_ROUTED1(FrameMsg_ViewChanged, ...@@ -607,11 +595,6 @@ IPC_MESSAGE_ROUTED1(FrameMsg_ViewChanged,
IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings, IPC_MESSAGE_ROUTED1(FrameMsg_SetTextTrackSettings,
FrameMsg_TextTrackSettings_Params /* params */) FrameMsg_TextTrackSettings_Params /* params */)
// Informs the parent renderer that the child has completed an autoresize
// transaction and should update with the provided viz::LocalSurfaceId.
IPC_MESSAGE_ROUTED1(FrameMsg_DidUpdateVisualProperties,
cc::RenderFrameMetadata /* metadata */)
#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU) #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
......
...@@ -5,20 +5,27 @@ ...@@ -5,20 +5,27 @@
module content.mojom; module content.mojom;
import "ui/gfx/geometry/mojom/geometry.mojom"; import "ui/gfx/geometry/mojom/geometry.mojom";
import "content/common/render_frame_metadata.mojom";
// Mojo interface for communicating from RenderFrameProxy to // Mojo interface for communicating from RenderFrameProxy to
// RenderFrameProxyHost. // RenderFrameProxyHost. Implemented by the browser process, called by renderer
// processes.
interface RenderFrameProxyHost { interface RenderFrameProxyHost {
// TODO(dtapuska): Keep this interface for now. All methods have moved to // TODO(dtapuska): Keep this interface for now. All methods have moved to
// blink::RemoteFrameHost but we might still need this. // blink::RemoteFrameHost but we might still need this.
}; };
// Mojo interface for communicating from RenderFrameProxyHost to // Mojo interface for communicating from RenderFrameProxyHost to
// RenderFrameProxy. The Renderer process implements the below interface. // RenderFrameProxy. Implemented by renderer processes, called by the browser
// process.
interface RenderFrameProxy { interface RenderFrameProxy {
// This function enables auto-resize mode from the parent renderer. // This function enables auto-resize mode from the parent renderer.
EnableAutoResize(gfx.mojom.Size min_size, gfx.mojom.Size max_size); EnableAutoResize(gfx.mojom.Size min_size, gfx.mojom.Size max_size);
// This function disables auto-resize-mode from the parent renderer. // This function disables auto-resize-mode from the parent renderer.
DisableAutoResize(); DisableAutoResize();
// Informs the completion of an autoresize transaction from the parent
// renderer and updates with the provided viz::LocalSurfaceId.
DidUpdateVisualProperties(RenderFrameMetadata metadata);
}; };
...@@ -382,8 +382,6 @@ bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) { ...@@ -382,8 +382,6 @@ bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
OnEnforceInsecureRequestPolicy) OnEnforceInsecureRequestPolicy)
IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties,
OnSetFrameOwnerProperties) OnSetFrameOwnerProperties)
IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateVisualProperties,
OnDidUpdateVisualProperties)
IPC_MESSAGE_HANDLER(FrameMsg_TransferUserActivationFrom, IPC_MESSAGE_HANDLER(FrameMsg_TransferUserActivationFrom,
OnTransferUserActivationFrom) OnTransferUserActivationFrom)
IPC_MESSAGE_HANDLER(UnfreezableFrameMsg_DeleteProxy, OnDeleteProxy) IPC_MESSAGE_HANDLER(UnfreezableFrameMsg_DeleteProxy, OnDeleteProxy)
...@@ -460,7 +458,7 @@ void RenderFrameProxy::OnTransferUserActivationFrom(int32_t source_routing_id) { ...@@ -460,7 +458,7 @@ void RenderFrameProxy::OnTransferUserActivationFrom(int32_t source_routing_id) {
web_frame()->TransferUserActivationFrom(source_proxy->web_frame()); web_frame()->TransferUserActivationFrom(source_proxy->web_frame());
} }
void RenderFrameProxy::OnDidUpdateVisualProperties( void RenderFrameProxy::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) { const cc::RenderFrameMetadata& metadata) {
if (!parent_local_surface_id_allocator_->UpdateFromChild( if (!parent_local_surface_id_allocator_->UpdateFromChild(
metadata.local_surface_id_allocation.value_or( metadata.local_surface_id_allocation.value_or(
......
...@@ -229,10 +229,13 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener, ...@@ -229,10 +229,13 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
void OnEnforceInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy); void OnEnforceInsecureRequestPolicy(blink::WebInsecureRequestPolicy policy);
void OnSetFrameOwnerProperties(const FrameOwnerProperties& properties); void OnSetFrameOwnerProperties(const FrameOwnerProperties& properties);
void OnTransferUserActivationFrom(int32_t source_routing_id); void OnTransferUserActivationFrom(int32_t source_routing_id);
void OnDidUpdateVisualProperties(const cc::RenderFrameMetadata& metadata);
// mojom::RenderFrameProxy implementation:
void EnableAutoResize(const gfx::Size& min_size, void EnableAutoResize(const gfx::Size& min_size,
const gfx::Size& max_size) override; const gfx::Size& max_size) override;
void DisableAutoResize() override; void DisableAutoResize() override;
void DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) override;
// ChildFrameCompositor: // ChildFrameCompositor:
cc::Layer* GetLayer() override; cc::Layer* GetLayer() override;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment