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

Side by Side Diff: content/browser/power_save_blocker_common.cc

Issue 8340028: Salient parts of http://codereview.chromium.org/8392042/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/power_save_blocker.h" 5 #include "content/browser/power_save_blocker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 9
10 // Accessed only from the UI thread. 10 // Accessed only from the UI thread.
11 int PowerSaveBlocker::blocker_count_[kPowerSaveBlockPreventStateCount]; 11 int PowerSaveBlocker::blocker_count_[kPowerSaveBlockPreventStateCount];
12 12
13 PowerSaveBlocker::PowerSaveBlocker(PowerSaveBlockerType type) : type_(type) { 13 PowerSaveBlocker::PowerSaveBlocker(PowerSaveBlockerType type) : type_(type) {
14 DCHECK_LT(kPowerSaveBlockPreventNone, type); 14 DCHECK_LT(kPowerSaveBlockPreventNone, type);
15 DCHECK_GT(kPowerSaveBlockPreventStateCount, type); 15 DCHECK_GT(kPowerSaveBlockPreventStateCount, type);
16 std::vector<int> change(kPowerSaveBlockPreventStateCount); 16 std::vector<int> change(kPowerSaveBlockPreventStateCount);
17 ++change[type_]; 17 ++change[type_];
18 PostAdjustBlockCount(change); 18 PostAdjustBlockCount(change);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 for (PowerSaveBlockerType t = kPowerSaveBlockPreventDisplaySleep; 54 for (PowerSaveBlockerType t = kPowerSaveBlockPreventDisplaySleep;
55 t >= kPowerSaveBlockPreventSystemSleep; 55 t >= kPowerSaveBlockPreventSystemSleep;
56 t = static_cast<PowerSaveBlockerType>(t - 1)) { 56 t = static_cast<PowerSaveBlockerType>(t - 1)) {
57 if (blocker_count_[t]) 57 if (blocker_count_[t])
58 return t; 58 return t;
59 } 59 }
60 60
61 return kPowerSaveBlockPreventNone; 61 return kPowerSaveBlockPreventNone;
62 } 62 }
OLDNEW
« no previous file with comments | « content/browser/plugin_service_browsertest.cc ('k') | content/browser/power_save_blocker_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698