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

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

Issue 1199543003: Fix tab switch time regression from backgrounded renderers change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Edit comment. Created 5 years, 6 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 | 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 6eb9cf4a30950c4ed61febde60ad747fa15ebceb..54bb53ff343c4e10bc39a390b14084d0fff04597 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -909,8 +909,16 @@ void RenderWidgetHostViewMac::WasOccluded() {
if (render_widget_host_->is_hidden())
return;
- render_widget_host_->WasHidden();
+ // SuspendBrowserCompositorView() instructs the GPU process to free up
+ // resources such as textures. WasHidden() places the renderer process in the
+ // background and throttles its I/O. We're cafeful to call WasHidden() only
+ // after calling SuspendBrowserCompositorView(), otherwise the backgrounded
+ // and throttled renderer's communication with GPU process will take extra
+ // time to complete. The delay will block the foreground renderer's
+ // communication with the GPU process, resulting in longer tab switching
+ // time. http://crbug.com/502502 .
SuspendBrowserCompositorView();
+ render_widget_host_->WasHidden();
}
void RenderWidgetHostViewMac::SetSize(const gfx::Size& size) {
« 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