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

Unified Diff: media/video/capture/screen/screen_capturer_win.cc

Issue 12211101: Assert both display and system keep-alive on each capture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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: media/video/capture/screen/screen_capturer_win.cc
diff --git a/media/video/capture/screen/screen_capturer_win.cc b/media/video/capture/screen/screen_capturer_win.cc
index 796af5f85ea86b648598767a10e3fb9ef8914cdb..219641ecde45b5cfc63a2483ce907ef765b6e8aa 100644
--- a/media/video/capture/screen/screen_capturer_win.cc
+++ b/media/video/capture/screen/screen_capturer_win.cc
@@ -216,8 +216,10 @@ void ScreenCapturerWin::InvalidateRegion(const SkRegion& invalid_region) {
void ScreenCapturerWin::CaptureFrame() {
base::Time capture_start_time = base::Time::Now();
- // Force the system to power-up display hardware, if it has been suspended.
- SetThreadExecutionState(ES_DISPLAY_REQUIRED);
+ // Request that the system not power-down the system, or the display hardware.
+ if (!SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)) {
+ LOG(WARNING) << "Failed to make system & display power assertion";
alexeypa (please no reviews) 2013/02/11 17:02:28 nit #1: LOG_GETLASTERROR(WARNING). nit #2: this w
Wez 2013/02/12 01:52:46 I've settled on just logging the first failure per
+ }
// Make sure the GDI capture resources are up-to-date.
PrepareCaptureResources();
« 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