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

Side by Side Diff: chrome/browser/power_save_blocker_mac.cc

Issue 6594063: Update a bunch of files to the new location of browser_thread.h (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/process_singleton_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/power_save_blocker.h" 5 #include "chrome/browser/power_save_blocker.h"
6 6
7 #include <IOKit/pwr_mgt/IOPMLib.h> 7 #include <IOKit/pwr_mgt/IOPMLib.h>
8 8
9 #include "chrome/browser/browser_thread.h" 9 #include "content/browser/browser_thread.h"
10 10
11 // Run on the UI thread only. 11 // Run on the UI thread only.
12 void PowerSaveBlocker::ApplyBlock(bool blocking) { 12 void PowerSaveBlocker::ApplyBlock(bool blocking) {
13 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 13 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
14 14
15 // Block just idle sleep; allow display sleep. 15 // Block just idle sleep; allow display sleep.
16 // See QA1340 <http://developer.apple.com/library/mac/#qa/qa2004/qa1340.html> 16 // See QA1340 <http://developer.apple.com/library/mac/#qa/qa2004/qa1340.html>
17 // for more details. 17 // for more details.
18 18
19 static IOPMAssertionID sleep_assertion = kIOPMNullAssertionID; 19 static IOPMAssertionID sleep_assertion = kIOPMNullAssertionID;
20 IOReturn result; 20 IOReturn result;
21 if (blocking) { 21 if (blocking) {
22 DCHECK_EQ(sleep_assertion, kIOPMNullAssertionID); 22 DCHECK_EQ(sleep_assertion, kIOPMNullAssertionID);
23 result = IOPMAssertionCreate( 23 result = IOPMAssertionCreate(
24 kIOPMAssertionTypeNoIdleSleep, 24 kIOPMAssertionTypeNoIdleSleep,
25 kIOPMAssertionLevelOn, 25 kIOPMAssertionLevelOn,
26 &sleep_assertion); 26 &sleep_assertion);
27 } else { 27 } else {
28 DCHECK_NE(sleep_assertion, kIOPMNullAssertionID); 28 DCHECK_NE(sleep_assertion, kIOPMNullAssertionID);
29 result = IOPMAssertionRelease(sleep_assertion); 29 result = IOPMAssertionRelease(sleep_assertion);
30 sleep_assertion = kIOPMNullAssertionID; 30 sleep_assertion = kIOPMNullAssertionID;
31 } 31 }
32 32
33 if (result != kIOReturnSuccess) { 33 if (result != kIOReturnSuccess) {
34 NOTREACHED(); 34 NOTREACHED();
35 } 35 }
36 } 36 }
OLDNEW
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/process_singleton_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698