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

Issue 684343002: Mac: Use Mavericks occlusion APIs for power savings. (Closed)

Created:
6 years, 1 month ago by ccameron
Modified:
6 years, 1 month ago
Reviewers:
Avi (use Gerrit), Andre, miu
CC:
chromium-reviews, James Su, yusukes+watch_chromium.org, yukishiino+watch_chromium.org, jam, penghuang+watch_chromium.org, nona+watch_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Mac: Use Mavericks occlusion APIs for power savings. Use NSWindowDidChangeOcclusionStateNotification (new in 10.9 Mavericks) to detect when the application is hidden, the window is minimized or obscured by another window. Send the WasHidden to the WebContentsImpl, because this will take into account tab capture. When RenderWidgetHostViewMac::WasHidden is called, the previous behavior was to destroy the BrowserCompositorViewMac. This has the undesirable effect of creating a white flash when a hidden window is re-exposed. To prevent this, only destroy the BrowserCompositorViewMac when the the RenderWidgetHostViewMac is removed from all NSWindows. Manage the state of BrowserCompositorViewMac explicitly as being Active (previously whenever it existed), Suspended (the new state where it is kept around, but the RWH and DFH are hidden), and Destroyed (previously wherever it did not exist). Move some 10.7 APIs to base because they belong there, not in content. BUG=310374 Committed: https://crrev.com/044d85df5e5e3fbf5d826c694ebf5d4bca7706ce Cr-Commit-Position: refs/heads/master@{#302160}

Patch Set 1 #

Patch Set 2 : Add NULL check #

Patch Set 3 : Retry upload #

Total comments: 9

Patch Set 4 : Incorporate review feedback #

Patch Set 5 : Incorporate review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -27 lines) Patch
M base/mac/sdk_forward_declarations.h View 1 2 chunks +6 lines, -0 lines 0 comments Download
M base/mac/sdk_forward_declarations.mm View 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.h View 1 2 3 3 chunks +40 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_widget_host_view_mac.mm View 1 2 3 4 6 chunks +63 lines, -26 lines 0 comments Download
M content/browser/web_contents/web_contents_view_mac.mm View 1 2 3 4 2 chunks +43 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
ccameron
This is Andre's patch from https://codereview.chromium.org/666123003/, with some additional work added to RenderWidgetHostViewMac to avoid ...
6 years, 1 month ago (2014-10-29 23:33:43 UTC) #2
Andre
https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h File content/browser/renderer_host/render_widget_host_view_mac.h (right): https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h#newcode396 content/browser/renderer_host/render_widget_host_view_mac.h:396: // - This happens when |cocoa_view_| is occluded by ...
6 years, 1 month ago (2014-10-30 03:19:26 UTC) #3
miu
lgtm https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h File content/browser/renderer_host/render_widget_host_view_mac.h (right): https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h#newcode402 content/browser/renderer_host/render_widget_host_view_mac.h:402: // |delegated_frame_host_| has been hidden. This is for ...
6 years, 1 month ago (2014-10-30 18:33:44 UTC) #4
ccameron
Thanks! Adding avi for base review. https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h File content/browser/renderer_host/render_widget_host_view_mac.h (right): https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h#newcode396 content/browser/renderer_host/render_widget_host_view_mac.h:396: // - This ...
6 years, 1 month ago (2014-10-30 19:23:33 UTC) #6
Avi (use Gerrit)
lgtm https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h File content/browser/renderer_host/render_widget_host_view_mac.h (right): https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.h#newcode408 content/browser/renderer_host/render_widget_host_view_mac.h:408: }; I love these comments. https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm ...
6 years, 1 month ago (2014-10-30 19:32:52 UTC) #7
ccameron
Thanks! https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.mm File content/browser/renderer_host/render_widget_host_view_mac.mm (right): https://codereview.chromium.org/684343002/diff/40001/content/browser/renderer_host/render_widget_host_view_mac.mm#newcode3089 content/browser/renderer_host/render_widget_host_view_mac.mm:3089: // If the RenderWidgetHostViewCocoa is being removed its ...
6 years, 1 month ago (2014-10-30 19:52:11 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/684343002/80001
6 years, 1 month ago (2014-10-30 19:53:21 UTC) #10
commit-bot: I haz the power
Committed patchset #5 (id:80001)
6 years, 1 month ago (2014-10-30 21:34:13 UTC) #11
commit-bot: I haz the power
6 years, 1 month ago (2014-10-30 21:34:55 UTC) #12
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/044d85df5e5e3fbf5d826c694ebf5d4bca7706ce
Cr-Commit-Position: refs/heads/master@{#302160}

Powered by Google App Engine
This is Rietveld 408576698