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

Side by Side Diff: chrome/browser/power_save_blocker.h

Issue 287017: Disable system suspend while downloading files on win32.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: 'Fix Created 11 years, 2 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/download/download_file.cc ('k') | chrome/browser/power_save_blocker_common.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_POWER_SAVE_BLOCKER_H_
6 #define CHROME_BROWSER_POWER_SAVE_BLOCKER_H_
7
8 #include "base/basictypes.h"
9
10 // A RAII-style class to block the system from entering low-power
11 // (sleep) mode.
12 class PowerSaveBlocker {
13 public:
14 explicit PowerSaveBlocker(bool enabled);
15 ~PowerSaveBlocker();
16
17 bool enabled() const { return enabled_; }
18
19 // Puts the sleep mode block into effect.
20 void Enable();
21 // Disables the sleep block.
22 void Disable();
23
24 private:
25 // Platform-specific function called when enable state is changed.
26 // Guarenteed to be called only from the UI thread.
27 static void ApplyBlock(bool blocked);
28
29 // Called only from UI thread.
30 static void AdjustBlockCount(int delta);
31
32 // Invokes AdjustBlockCount on the UI thread.
33 static void PostAdjustBlockCount(int delta);
34
35 bool enabled_;
36
37 static int blocker_count_;
38
39 DISALLOW_COPY_AND_ASSIGN(PowerSaveBlocker);
40 };
41
42 #endif // CHROME_BROWSER_POWER_SAVE_BLOCKER_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_file.cc ('k') | chrome/browser/power_save_blocker_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698