Commit 8be47737 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

Remove early call to DidResizeOrRepaintAck()

Previously, we would defer commit when the child didn't yet have a
LocalSurfaceId. This meant we needed a special case to call
DidResizeOrRepaintAck() early when commit would be deferred.

But now the child has the ability to allocate its own
LocalSurfaceId. As a result, we no longer need to defer commit. And
thus, no longer need to call DidResizeOrRepaintAck() early.

BUG=805073,811944,836009

Change-Id: I4e85e926f217cf0fd2d4b5ed3854f09e7145e5a8
Reviewed-on: https://chromium-review.googlesource.com/1024739Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarFady Samuel <fsamuel@chromium.org>
Commit-Queue: Fady Samuel <fsamuel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553276}
parent 15f0a4cc
......@@ -1978,7 +1978,6 @@ void RenderViewImpl::OnResize(const ResizeParams& params) {
params.max_size_for_auto_resize);
}
} else if (auto_resize_mode_changed) {
auto_resize_ack_callback_.Cancel();
need_resize_ack_for_auto_resize_ = false;
webview()->DisableAutoResizeMode();
if (params.new_size.IsEmpty())
......
......@@ -2288,22 +2288,8 @@ void RenderWidget::DidAutoResize(const gfx::Size& new_size) {
UpdateSurfaceAndScreenInfo(
local_surface_id, new_compositor_viewport_pixel_size, screen_info_);
if (!resizing_mode_selector_->is_synchronous_mode()) {
if (!resizing_mode_selector_->is_synchronous_mode())
need_resize_ack_for_auto_resize_ = true;
// If surface synchronization is off, then ResizeAcks go to the browser in
// response to a DidReceiveCompositorFrame. With surface synchronization
// on, that notification will not arrive here because the compositor is
// deferring commits and thus submission of CompositorFrames.
if (!size_.IsEmpty() && compositor_ &&
compositor_->IsSurfaceSynchronizationEnabled() &&
!auto_resize_ack_callback_.callback()) {
auto_resize_ack_callback_.Reset(
base::BindOnce(&RenderWidget::DidResizeOrRepaintAck,
weak_ptr_factory_.GetWeakPtr()));
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, auto_resize_ack_callback_.callback());
}
}
}
}
......
......@@ -748,11 +748,6 @@ class CONTENT_EXPORT RenderWidget
// The maximum size to use for auto-resize.
gfx::Size max_size_for_auto_resize_;
// A pending ResizeOrRepaintAck callback in response to an auto-resize
// initiated by Blink. If auto-resize mode is canceled with an in-flight
// Ack, then the Ack will be canceled.
base::CancelableOnceClosure auto_resize_ack_callback_;
// Set to true if we should ignore RenderWidget::Show calls.
bool did_show_;
......
......@@ -439,7 +439,7 @@ TEST_F(RenderWidgetUnittest, SurfaceSynchronizationAutoResizeThrottling) {
// Issue an auto-resize.
widget()->DidAutoResize(auto_size);
widget()->sink()->ClearMessages();
base::RunLoop().RunUntilIdle();
widget()->DidCommitCompositorFrame();
const IPC::Message* message = widget()->sink()->GetUniqueMessageMatching(
ViewHostMsg_ResizeOrRepaint_ACK::ID);
ASSERT_TRUE(message);
......
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