Commit 7ac86726 authored by Julie Jeongeun Kim's avatar Julie Jeongeun Kim Committed by Commit Bot

Convert FrameHostMsg_UpdateRenderThrottlingStatus to mojo

This CL converts FrameHostMsg_UpdateRenderThrottlingStatus to
RemoteFrameHost blink interface. It removes
UpdateRenderThrottlingStatus from WebRemoteFrameClient.

Bug: 1047362
Change-Id: Icc479058169016353dc58039aa4f311c5d1534da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053872Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Julie Kim <jkim@igalia.com>
Cr-Commit-Position: refs/heads/master@{#741408}
parent 83148a5f
...@@ -73,8 +73,6 @@ bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) { ...@@ -73,8 +73,6 @@ bool CrossProcessFrameConnector::OnMessageReceived(const IPC::Message& msg) {
OnSynchronizeVisualProperties) OnSynchronizeVisualProperties)
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateViewportIntersection, IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateViewportIntersection,
OnUpdateViewportIntersection) OnUpdateViewportIntersection)
IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateRenderThrottlingStatus,
OnUpdateRenderThrottlingStatus)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
...@@ -460,7 +458,7 @@ void CrossProcessFrameConnector::ResetScreenSpaceRect() { ...@@ -460,7 +458,7 @@ void CrossProcessFrameConnector::ResetScreenSpaceRect() {
last_received_local_frame_size_ = gfx::Size(); last_received_local_frame_size_ = gfx::Size();
} }
void CrossProcessFrameConnector::OnUpdateRenderThrottlingStatus( void CrossProcessFrameConnector::UpdateRenderThrottlingStatus(
bool is_throttled, bool is_throttled,
bool subtree_throttled) { bool subtree_throttled) {
if (is_throttled != is_throttled_ || if (is_throttled != is_throttled_ ||
......
...@@ -127,6 +127,8 @@ class CONTENT_EXPORT CrossProcessFrameConnector ...@@ -127,6 +127,8 @@ class CONTENT_EXPORT CrossProcessFrameConnector
return GetRootRenderWidgetHostView(); return GetRootRenderWidgetHostView();
} }
void UpdateRenderThrottlingStatus(bool is_throttled, bool subtree_throttled);
// These enums back crashed frame histograms - see MaybeLogCrash() and // These enums back crashed frame histograms - see MaybeLogCrash() and
// MaybeLogShownCrash() below. Please do not modify or remove existing enum // MaybeLogShownCrash() below. Please do not modify or remove existing enum
// values. When adding new values, please also update enums.xml. See // values. When adding new values, please also update enums.xml. See
...@@ -180,8 +182,6 @@ class CONTENT_EXPORT CrossProcessFrameConnector ...@@ -180,8 +182,6 @@ class CONTENT_EXPORT CrossProcessFrameConnector
const FrameVisualProperties& visual_properties); const FrameVisualProperties& visual_properties);
void OnUpdateViewportIntersection( void OnUpdateViewportIntersection(
const blink::ViewportIntersectionState& viewport_intersection); const blink::ViewportIntersectionState& viewport_intersection);
void OnUpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled);
// Gets the current RenderFrameHost for the // Gets the current RenderFrameHost for the
// |frame_proxy_in_parent_renderer_|'s (i.e., the child frame's) // |frame_proxy_in_parent_renderer_|'s (i.e., the child frame's)
......
...@@ -326,6 +326,13 @@ void RenderFrameProxyHost::SetInheritedEffectiveTouchAction( ...@@ -326,6 +326,13 @@ void RenderFrameProxyHost::SetInheritedEffectiveTouchAction(
touch_action); touch_action);
} }
void RenderFrameProxyHost::UpdateRenderThrottlingStatus(
bool is_throttled,
bool subtree_throttled) {
cross_process_frame_connector_->UpdateRenderThrottlingStatus(
is_throttled, subtree_throttled);
}
void RenderFrameProxyHost::VisibilityChanged( void RenderFrameProxyHost::VisibilityChanged(
blink::mojom::FrameVisibility visibility) { blink::mojom::FrameVisibility visibility) {
cross_process_frame_connector_->OnVisibilityChanged(visibility); cross_process_frame_connector_->OnVisibilityChanged(visibility);
......
...@@ -148,6 +148,8 @@ class CONTENT_EXPORT RenderFrameProxyHost ...@@ -148,6 +148,8 @@ class CONTENT_EXPORT RenderFrameProxyHost
// blink::mojom::RemoteFrameHost // blink::mojom::RemoteFrameHost
void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override; void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override;
void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) override;
void VisibilityChanged(blink::mojom::FrameVisibility visibility) override; void VisibilityChanged(blink::mojom::FrameVisibility visibility) override;
void DidFocusFrame() override; void DidFocusFrame() override;
void CheckCompleted() override; void CheckCompleted() override;
......
...@@ -910,14 +910,6 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_SynchronizeVisualProperties, ...@@ -910,14 +910,6 @@ IPC_MESSAGE_ROUTED2(FrameHostMsg_SynchronizeVisualProperties,
IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateViewportIntersection, IPC_MESSAGE_ROUTED1(FrameHostMsg_UpdateViewportIntersection,
blink::ViewportIntersectionState /* intersection_state */) blink::ViewportIntersectionState /* intersection_state */)
// Toggles render throttling on a remote frame. |is_throttled| indicates
// whether the current frame should be throttled based on its viewport
// visibility, and |subtree_throttled| indicates that an ancestor frame has
// been throttled, so all descendant frames also should be throttled.
IPC_MESSAGE_ROUTED2(FrameHostMsg_UpdateRenderThrottlingStatus,
bool /* is_throttled */,
bool /* subtree_throttled */)
// Transfers user activation state from the source frame to the current frame. // Transfers user activation state from the source frame to the current frame.
IPC_MESSAGE_ROUTED1(FrameMsg_TransferUserActivationFrom, IPC_MESSAGE_ROUTED1(FrameMsg_TransferUserActivationFrom,
int /* source_routing_id */) int /* source_routing_id */)
......
...@@ -736,12 +736,6 @@ void RenderFrameProxy::UpdateRemoteViewportIntersection( ...@@ -736,12 +736,6 @@ void RenderFrameProxy::UpdateRemoteViewportIntersection(
Send(new FrameHostMsg_UpdateViewportIntersection(routing_id_, new_state)); Send(new FrameHostMsg_UpdateViewportIntersection(routing_id_, new_state));
} }
void RenderFrameProxy::UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) {
Send(new FrameHostMsg_UpdateRenderThrottlingStatus(routing_id_, is_throttled,
subtree_throttled));
}
void RenderFrameProxy::DidChangeOpener(blink::WebFrame* opener) { void RenderFrameProxy::DidChangeOpener(blink::WebFrame* opener) {
// A proxy shouldn't normally be disowning its opener. It is possible to get // A proxy shouldn't normally be disowning its opener. It is possible to get
// here when a proxy that is being detached clears its opener, in which case // here when a proxy that is being detached clears its opener, in which case
......
...@@ -190,8 +190,6 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener, ...@@ -190,8 +190,6 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
const blink::WebRect& screen_space_rect) override; const blink::WebRect& screen_space_rect) override;
void UpdateRemoteViewportIntersection( void UpdateRemoteViewportIntersection(
const blink::ViewportIntersectionState& intersection_state) override; const blink::ViewportIntersectionState& intersection_state) override;
void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) override;
void DidChangeOpener(blink::WebFrame* opener) override; void DidChangeOpener(blink::WebFrame* opener) override;
void AdvanceFocus(blink::mojom::FocusType type, void AdvanceFocus(blink::mojom::FocusType type,
blink::WebLocalFrame* source) override; blink::WebLocalFrame* source) override;
......
...@@ -373,6 +373,12 @@ interface RemoteFrameHost { ...@@ -373,6 +373,12 @@ interface RemoteFrameHost {
// the associated LocalFrame in the other render process. // the associated LocalFrame in the other render process.
SetInheritedEffectiveTouchAction(cc.mojom.TouchAction touch_action); SetInheritedEffectiveTouchAction(cc.mojom.TouchAction touch_action);
// Toggles render throttling on a remote frame. |is_throttled| indicates
// whether the current frame should be throttled based on its viewport
// visibility, and |subtree_throttled| indicates that an ancestor frame has
// been throttled, so all descendant frames also should be throttled.
UpdateRenderThrottlingStatus(bool is_throttled, bool subtree_throttled);
// Notifies the browser that the associated frame has changed its visibility // Notifies the browser that the associated frame has changed its visibility
// status. Visibility status changes occur when the frame moves in/out // status. Visibility status changes occur when the frame moves in/out
// of the viewport, or the need for a layout object changes, e.g. if the // of the viewport, or the need for a layout object changes, e.g. if the
......
...@@ -48,10 +48,6 @@ class WebRemoteFrameClient { ...@@ -48,10 +48,6 @@ class WebRemoteFrameClient {
virtual void UpdateRemoteViewportIntersection( virtual void UpdateRemoteViewportIntersection(
const ViewportIntersectionState& intersection_state) {} const ViewportIntersectionState& intersection_state) {}
// Toggles render throttling for the remote frame.
virtual void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) {}
// This frame updated its opener to another frame. // This frame updated its opener to another frame.
virtual void DidChangeOpener(WebFrame* opener) {} virtual void DidChangeOpener(WebFrame* opener) {}
......
...@@ -53,9 +53,6 @@ class RemoteFrameClient : public FrameClient { ...@@ -53,9 +53,6 @@ class RemoteFrameClient : public FrameClient {
virtual void AdvanceFocus(mojom::blink::FocusType, LocalFrame* source) = 0; virtual void AdvanceFocus(mojom::blink::FocusType, LocalFrame* source) = 0;
virtual void UpdateRenderThrottlingStatus(bool isThrottled,
bool subtreeThrottled) = 0;
virtual uint32_t Print(const IntRect&, cc::PaintCanvas*) const = 0; virtual uint32_t Print(const IntRect&, cc::PaintCanvas*) const = 0;
}; };
......
...@@ -152,13 +152,6 @@ void RemoteFrameClientImpl::AdvanceFocus(mojom::blink::FocusType type, ...@@ -152,13 +152,6 @@ void RemoteFrameClientImpl::AdvanceFocus(mojom::blink::FocusType type,
WebLocalFrameImpl::FromFrame(source)); WebLocalFrameImpl::FromFrame(source));
} }
void RemoteFrameClientImpl::UpdateRenderThrottlingStatus(
bool is_throttled,
bool subtree_throttled) {
web_frame_->Client()->UpdateRenderThrottlingStatus(is_throttled,
subtree_throttled);
}
uint32_t RemoteFrameClientImpl::Print(const IntRect& rect, uint32_t RemoteFrameClientImpl::Print(const IntRect& rect,
cc::PaintCanvas* canvas) const { cc::PaintCanvas* canvas) const {
return web_frame_->Client()->Print(rect, canvas); return web_frame_->Client()->Print(rect, canvas);
......
...@@ -48,8 +48,6 @@ class RemoteFrameClientImpl final : public RemoteFrameClient { ...@@ -48,8 +48,6 @@ class RemoteFrameClientImpl final : public RemoteFrameClient {
void UpdateRemoteViewportIntersection( void UpdateRemoteViewportIntersection(
const ViewportIntersectionState& intersection_state) override; const ViewportIntersectionState& intersection_state) override;
void AdvanceFocus(mojom::blink::FocusType, LocalFrame*) override; void AdvanceFocus(mojom::blink::FocusType, LocalFrame*) override;
void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) override;
uint32_t Print(const IntRect&, cc::PaintCanvas*) const override; uint32_t Print(const IntRect&, cc::PaintCanvas*) const override;
WebRemoteFrameImpl* GetWebFrame() const { return web_frame_; } WebRemoteFrameImpl* GetWebFrame() const { return web_frame_; }
......
...@@ -261,10 +261,8 @@ void RemoteFrameView::ParentVisibleChanged() { ...@@ -261,10 +261,8 @@ void RemoteFrameView::ParentVisibleChanged() {
void RemoteFrameView::VisibilityForThrottlingChanged() { void RemoteFrameView::VisibilityForThrottlingChanged() {
TRACE_EVENT0("blink", "RemoteFrameView::VisibilityForThrottlingChanged"); TRACE_EVENT0("blink", "RemoteFrameView::VisibilityForThrottlingChanged");
if (!remote_frame_->Client()) remote_frame_->GetRemoteFrameHostRemote().UpdateRenderThrottlingStatus(
return; IsHiddenForThrottling(), IsSubtreeThrottled());
remote_frame_->Client()->UpdateRenderThrottlingStatus(IsHiddenForThrottling(),
IsSubtreeThrottled());
} }
void RemoteFrameView::VisibilityChanged( void RemoteFrameView::VisibilityChanged(
......
...@@ -452,8 +452,6 @@ class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient { ...@@ -452,8 +452,6 @@ class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient {
void UpdateRemoteViewportIntersection( void UpdateRemoteViewportIntersection(
const ViewportIntersectionState& intersection_state) override {} const ViewportIntersectionState& intersection_state) override {}
void AdvanceFocus(mojom::blink::FocusType, LocalFrame* source) override {} void AdvanceFocus(mojom::blink::FocusType, LocalFrame* source) override {}
void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) override {}
uint32_t Print(const IntRect& rect, cc::PaintCanvas* canvas) const override { uint32_t Print(const IntRect& rect, cc::PaintCanvas* canvas) const override {
return 0; return 0;
} }
......
...@@ -16,6 +16,10 @@ void FakeRemoteFrameHost::Init(blink::AssociatedInterfaceProvider* provider) { ...@@ -16,6 +16,10 @@ void FakeRemoteFrameHost::Init(blink::AssociatedInterfaceProvider* provider) {
void FakeRemoteFrameHost::SetInheritedEffectiveTouchAction( void FakeRemoteFrameHost::SetInheritedEffectiveTouchAction(
cc::TouchAction touch_action) {} cc::TouchAction touch_action) {}
void FakeRemoteFrameHost::UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) {
}
void FakeRemoteFrameHost::VisibilityChanged( void FakeRemoteFrameHost::VisibilityChanged(
mojom::blink::FrameVisibility visibility) {} mojom::blink::FrameVisibility visibility) {}
......
...@@ -22,6 +22,8 @@ class FakeRemoteFrameHost : public mojom::blink::RemoteFrameHost { ...@@ -22,6 +22,8 @@ class FakeRemoteFrameHost : public mojom::blink::RemoteFrameHost {
void Init(blink::AssociatedInterfaceProvider* provider); void Init(blink::AssociatedInterfaceProvider* provider);
void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override; void SetInheritedEffectiveTouchAction(cc::TouchAction touch_action) override;
void UpdateRenderThrottlingStatus(bool is_throttled,
bool subtree_throttled) override;
void VisibilityChanged(mojom::blink::FrameVisibility visibility) override; void VisibilityChanged(mojom::blink::FrameVisibility visibility) override;
void DidFocusFrame() override; void DidFocusFrame() override;
void CheckCompleted() override; void CheckCompleted() 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