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

Unified Diff: content/renderer/render_widget.cc

Issue 14779010: Don't expect ack for ViewMsg_OnResize if backing size is empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep short_circuit_size_update condition Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/render_widget_test.cc ('k') | content/renderer/render_widget_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_widget.cc
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index d4a55d6075564736399c4b010ae9cb21a701d9df..d594bb42fc05c723db25f9dfe00dc3f8b833eab5 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -406,12 +406,19 @@ void RenderWidget::Resize(const gfx::Size& new_size,
// Resize should have caused an invalidation of the entire view.
DCHECK(new_size.IsEmpty() || is_accelerated_compositing_active_ ||
paint_aggregator_.HasPendingUpdate());
- } else if (!RenderThreadImpl::current()->short_circuit_size_updates()) {
+ } else if (!RenderThreadImpl::current() || // Will be NULL during unit tests.
+ !RenderThreadImpl::current()->short_circuit_size_updates()) {
+ resize_ack = NO_RESIZE_ACK;
+ }
+
+ if (new_size.IsEmpty() || physical_backing_size.IsEmpty()) {
+ // For empty size or empty physical_backing_size, there is no next paint
+ // (along with which to send the ack) until they are set to non-empty.
resize_ack = NO_RESIZE_ACK;
}
// Send the Resize_ACK flag once we paint again if requested.
- if (resize_ack == SEND_RESIZE_ACK && !new_size.IsEmpty())
+ if (resize_ack == SEND_RESIZE_ACK)
set_next_paint_is_resize_ack();
if (fullscreen_change)
@@ -419,8 +426,7 @@ void RenderWidget::Resize(const gfx::Size& new_size,
// If a resize ack is requested and it isn't set-up, then no more resizes will
// come in and in general things will go wrong.
- DCHECK(resize_ack != SEND_RESIZE_ACK || new_size.IsEmpty() ||
- next_paint_is_resize_ack());
+ DCHECK(resize_ack != SEND_RESIZE_ACK || next_paint_is_resize_ack());
}
void RenderWidget::OnClose() {
« no previous file with comments | « content/public/test/render_widget_test.cc ('k') | content/renderer/render_widget_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698