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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2451953004: Fix mac raciness with initial needs begin frame state (Closed)
Patch Set: Fixes for ScrollWheelEndEventDelivery test Created 4 years, 2 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index cc31931f5b54c7d159506bb8a5ae3bd394cb43b9..f98d3b04d68adf49e81345e0ca5207929b82e634 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -451,7 +451,6 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
allow_pause_for_resize_or_repaint_(true),
is_guest_view_hack_(is_guest_view_hack),
fullscreen_parent_host_view_(nullptr),
- needs_begin_frames_(false),
needs_flush_input_(false),
weak_factory_(this) {
// |cocoa_view_| owns us and we will be deleted when |cocoa_view_|
@@ -494,6 +493,16 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
if (GetTextInputManager())
GetTextInputManager()->AddObserver(this);
+
+ // Because of the way Mac pumps messages during resize, (see the code
+ // in RenderMessageFilter::OnMessageReceived), SetNeedsBeginFrame
+ // messages are not delayed on Mac. This leads to creation-time
+ // raciness where renderer sends a SetNeedsBeginFrame(true) before
+ // the renderer host is created to recieve it. In general, all
+ // renderers want begin frames initially anyway, so start this value
+ // at true here to avoid startup raciness and decrease latency.
+ needs_begin_frames_ = true;
+ UpdateNeedsBeginFramesInternal();
}
RenderWidgetHostViewMac::~RenderWidgetHostViewMac() {
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698