Commit 4ecd1e40 authored by piman@chromium.org's avatar piman@chromium.org

Remove ViewHostMsg_UpdateIsDelayed

This message can only affect RenderWidgetHostImpl::WaitForSurface, which
is only called on Mac. However, it is never sent on mac. So just remove
it.

BUG=None

Review URL: https://codereview.chromium.org/273113005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@269685 0039d316-1c4b-4281-b951-d872f2087c98
parent 587926ad
...@@ -435,7 +435,6 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message, ...@@ -435,7 +435,6 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
#endif #endif
IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_UpdateRect, IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_UpdateRect,
render_widget_helper_->DidReceiveBackingStoreMsg(message)) render_widget_helper_->DidReceiveBackingStoreMsg(message))
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_CheckPermission, IPC_MESSAGE_HANDLER(DesktopNotificationHostMsg_CheckPermission,
OnCheckNotificationPermission) OnCheckNotificationPermission)
IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory, IPC_MESSAGE_HANDLER(ChildProcessHostMsg_SyncAllocateSharedMemory,
...@@ -1138,19 +1137,6 @@ void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin( ...@@ -1138,19 +1137,6 @@ void RenderMessageFilter::OnCompletedOpenChannelToNpapiPlugin(
plugin_host_clients_.erase(client); plugin_host_clients_.erase(client);
} }
void RenderMessageFilter::OnUpdateIsDelayed(const IPC::Message& msg) {
// When not in accelerated compositing mode, in certain cases (e.g. waiting
// for a resize or if no backing store) the RenderWidgetHost is blocking the
// UI thread for some time, waiting for an UpdateRect from the renderer. If we
// are going to switch to accelerated compositing, the GPU process may need
// round-trips to the UI thread before finishing the frame, causing deadlocks
// if we delay the UpdateRect until we receive the OnSwapBuffersComplete. So
// the renderer sent us this message, so that we can unblock the UI thread.
// We will simply re-use the UpdateRect unblock mechanism, just with a
// different message.
render_widget_helper_->DidReceiveBackingStoreMsg(msg);
}
void RenderMessageFilter::OnAre3DAPIsBlocked(int render_view_id, void RenderMessageFilter::OnAre3DAPIsBlocked(int render_view_id,
const GURL& top_origin_url, const GURL& top_origin_url,
ThreeDAPIType requester, ThreeDAPIType requester,
......
...@@ -260,7 +260,6 @@ class RenderMessageFilter : public BrowserMessageFilter { ...@@ -260,7 +260,6 @@ class RenderMessageFilter : public BrowserMessageFilter {
void OnCompletedOpenChannelToNpapiPlugin( void OnCompletedOpenChannelToNpapiPlugin(
OpenChannelToNpapiPluginCallback* client); OpenChannelToNpapiPluginCallback* client);
void OnUpdateIsDelayed(const IPC::Message& msg);
void OnAre3DAPIsBlocked(int render_view_id, void OnAre3DAPIsBlocked(int render_view_id,
const GURL& top_origin_url, const GURL& top_origin_url,
ThreeDAPIType requester, ThreeDAPIType requester,
......
...@@ -183,7 +183,6 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, ...@@ -183,7 +183,6 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
is_unresponsive_(false), is_unresponsive_(false),
in_flight_event_count_(0), in_flight_event_count_(0),
in_get_backing_store_(false), in_get_backing_store_(false),
abort_get_backing_store_(false),
view_being_painted_(false), view_being_painted_(false),
ignore_input_events_(false), ignore_input_events_(false),
input_method_active_(false), input_method_active_(false),
...@@ -467,7 +466,6 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) { ...@@ -467,7 +466,6 @@ bool RenderWidgetHostImpl::OnMessageReceived(const IPC::Message &msg) {
msg_is_ok = OnSwapCompositorFrame(msg)) msg_is_ok = OnSwapCompositorFrame(msg))
IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped) IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
...@@ -828,10 +826,8 @@ void RenderWidgetHostImpl::WaitForSurface() { ...@@ -828,10 +826,8 @@ void RenderWidgetHostImpl::WaitForSurface() {
// Break now if we got a backing store or accelerated surface of the // Break now if we got a backing store or accelerated surface of the
// correct size. // correct size.
if (view_->HasAcceleratedSurface(view_size) || abort_get_backing_store_) { if (view_->HasAcceleratedSurface(view_size))
abort_get_backing_store_ = false;
return; return;
}
} else { } else {
TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout"); TRACE_EVENT0("renderer_host", "WaitForSurface::Timeout");
break; break;
...@@ -1574,11 +1570,6 @@ void RenderWidgetHostImpl::OnUpdateRect( ...@@ -1574,11 +1570,6 @@ void RenderWidgetHostImpl::OnUpdateRect(
UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta); UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta);
} }
void RenderWidgetHostImpl::OnUpdateIsDelayed() {
if (in_get_backing_store_)
abort_get_backing_store_ = true;
}
void RenderWidgetHostImpl::DidUpdateBackingStore( void RenderWidgetHostImpl::DidUpdateBackingStore(
const ViewHostMsg_UpdateRect_Params& params, const ViewHostMsg_UpdateRect_Params& params,
const TimeTicks& paint_start) { const TimeTicks& paint_start) {
......
...@@ -637,7 +637,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl ...@@ -637,7 +637,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
bool OnSwapCompositorFrame(const IPC::Message& message); bool OnSwapCompositorFrame(const IPC::Message& message);
void OnFlingingStopped(); void OnFlingingStopped();
void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params); void OnUpdateRect(const ViewHostMsg_UpdateRect_Params& params);
void OnUpdateIsDelayed();
void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet); void OnQueueSyntheticGesture(const SyntheticGesturePacket& gesture_packet);
virtual void OnFocus(); virtual void OnFocus();
virtual void OnBlur(); virtual void OnBlur();
...@@ -820,9 +819,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl ...@@ -820,9 +819,6 @@ class CONTENT_EXPORT RenderWidgetHostImpl
// Flag to detect recursive calls to GetBackingStore(). // Flag to detect recursive calls to GetBackingStore().
bool in_get_backing_store_; bool in_get_backing_store_;
// Flag to trigger the GetBackingStore method to abort early.
bool abort_get_backing_store_;
// Set when we call DidPaintRect/DidScrollRect on the view. // Set when we call DidPaintRect/DidScrollRect on the view.
bool view_being_painted_; bool view_being_painted_;
......
...@@ -27,7 +27,6 @@ bool SwappedOutMessages::CanSendWhileSwappedOut(const IPC::Message* msg) { ...@@ -27,7 +27,6 @@ bool SwappedOutMessages::CanSendWhileSwappedOut(const IPC::Message* msg) {
case ViewHostMsg_RenderProcessGone::ID: case ViewHostMsg_RenderProcessGone::ID:
case ViewHostMsg_ClosePage_ACK::ID: case ViewHostMsg_ClosePage_ACK::ID:
case ViewHostMsg_SwapCompositorFrame::ID: case ViewHostMsg_SwapCompositorFrame::ID:
case ViewHostMsg_UpdateIsDelayed::ID:
case ViewHostMsg_DidActivateAcceleratedCompositing::ID: case ViewHostMsg_DidActivateAcceleratedCompositing::ID:
// Handled by WorkerMessageFilter (or by SharedWorkerMessageFilter when // Handled by WorkerMessageFilter (or by SharedWorkerMessageFilter when
// embedded-shared-worker is enabled). // embedded-shared-worker is enabled).
......
...@@ -1165,10 +1165,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent, ...@@ -1165,10 +1165,6 @@ IPC_MESSAGE_ROUTED2(ViewHostMsg_DidRunInsecureContent,
IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect, IPC_MESSAGE_ROUTED1(ViewHostMsg_UpdateRect,
ViewHostMsg_UpdateRect_Params) ViewHostMsg_UpdateRect_Params)
// Sent to unblock the browser's UI thread if it is waiting on an UpdateRect,
// which may get delayed until the browser's UI unblocks.
IPC_MESSAGE_ROUTED0(ViewHostMsg_UpdateIsDelayed)
// Sent by the renderer when accelerated compositing is enabled or disabled to // Sent by the renderer when accelerated compositing is enabled or disabled to
// notify the browser whether or not is should do painting. // notify the browser whether or not is should do painting.
IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing, IPC_MESSAGE_ROUTED1(ViewHostMsg_DidActivateAcceleratedCompositing,
......
...@@ -1236,21 +1236,6 @@ void RenderWidget::AutoResizeCompositor() { ...@@ -1236,21 +1236,6 @@ void RenderWidget::AutoResizeCompositor() {
void RenderWidget::didActivateCompositor() { void RenderWidget::didActivateCompositor() {
TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor"); TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor");
#if !defined(OS_MACOSX)
if (!is_accelerated_compositing_active_) {
// When not in accelerated compositing mode, in certain cases (e.g. waiting
// for a resize or if no backing store) the RenderWidgetHost is blocking the
// browser's UI thread for some time, waiting for an UpdateRect. If we are
// going to switch to accelerated compositing, the GPU process may need
// round-trips to the browser's UI thread before finishing the frame,
// causing deadlocks if we delay the UpdateRect until we receive the
// OnSwapBuffersComplete. So send a dummy message that will unblock the
// browser's UI thread. This is not necessary on Mac, because SwapBuffers
// now unblocks GetBackingStore on Mac.
Send(new ViewHostMsg_UpdateIsDelayed(routing_id_));
}
#endif
is_accelerated_compositing_active_ = true; is_accelerated_compositing_active_ = true;
Send(new ViewHostMsg_DidActivateAcceleratedCompositing( Send(new ViewHostMsg_DidActivateAcceleratedCompositing(
routing_id_, is_accelerated_compositing_active_)); routing_id_, is_accelerated_compositing_active_));
......
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