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

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

Issue 2577953002: Fix a bug where an infinite stream of BeginFrame messages are sent to extensions. (Closed)
Patch Set: Created 4 years 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 | no next file » | 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 5bef4d03ad0ff4c71539729b9cb150b3702aecd1..841472195484f37d9cba1c93c8377e08c108aebb 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -484,10 +484,12 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
}
RenderViewHost* rvh = RenderViewHost::From(render_widget_host_);
+ bool needs_begin_frames = true;
if (rvh) {
danakj 2016/12/15 15:56:59 So, when is this null? I got as far RenderViewHost
erikchen 2016/12/15 16:51:11 I agree that I don't see how rvh could be nullptr.
// TODO(mostynb): actually use prefs. Landing this as a separate CL
// first to rebaseline some unreliable layout tests.
ignore_result(rvh->GetWebkitPreferences());
+ needs_begin_frames = !rvh->GetDelegate()->IsNeverVisible();
}
if (GetTextInputManager())
@@ -497,10 +499,15 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
// 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;
+ // the renderer host is created to recieve it.
+ //
+ // A renderer wants begin frames initially if and only if
danakj 2016/12/15 15:56:59 IsNeverVisible should not change, thats why its na
erikchen 2016/12/15 16:51:11 Done.
+ // |rvh->GetDelegate()->IsNeverVisible()| evalutes to false. If this statement
+ // becomes false, then we will need to update this logic to ensure that
+ // |needs_begin_frames_| stays synchronized between the browser and the
+ // renderer. The benefit of starting it as true is that it reduces startup
+ // raciness and decreases latency.
+ needs_begin_frames_ = needs_begin_frames;
UpdateNeedsBeginFramesInternal();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698