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

Unified Diff: content/browser/power_save_blocker_mac.cc

Issue 946643002: Use PowerSaveBlocker for audio and video on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply nits Created 5 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 | « content/browser/power_save_blocker_impl.cc ('k') | content/browser/power_save_blocker_ozone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/power_save_blocker_mac.cc
diff --git a/content/browser/power_save_blocker_mac.cc b/content/browser/power_save_blocker_mac.cc
index 9b3fe090c3c56bc7f97dc7a763b81e18696f3ad6..ca466606cf8ea07bb8a3ac7ecbfe619c671e0d54 100644
--- a/content/browser/power_save_blocker_mac.cc
+++ b/content/browser/power_save_blocker_mac.cc
@@ -41,8 +41,10 @@ base::LazyInstance<base::Thread, PowerSaveBlockerLazyInstanceTraits>
class PowerSaveBlockerImpl::Delegate
: public base::RefCountedThreadSafe<PowerSaveBlockerImpl::Delegate> {
public:
- Delegate(PowerSaveBlockerType type, const std::string& reason)
- : type_(type), reason_(reason), assertion_(kIOPMNullAssertionID) {}
+ Delegate(PowerSaveBlockerType type, const std::string& description)
+ : type_(type),
+ description_(description),
+ assertion_(kIOPMNullAssertionID) {}
// Does the actual work to apply or remove the desired power save block.
void ApplyBlock();
@@ -52,7 +54,7 @@ class PowerSaveBlockerImpl::Delegate
friend class base::RefCountedThreadSafe<Delegate>;
~Delegate() {}
PowerSaveBlockerType type_;
- std::string reason_;
+ std::string description_;
IOPMAssertionID assertion_;
};
@@ -75,12 +77,10 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock() {
break;
}
if (level) {
- base::ScopedCFTypeRef<CFStringRef> cf_reason(
- base::SysUTF8ToCFStringRef(reason_));
- IOReturn result = IOPMAssertionCreateWithName(level,
- kIOPMAssertionLevelOn,
- cf_reason,
- &assertion_);
+ base::ScopedCFTypeRef<CFStringRef> cf_description(
+ base::SysUTF8ToCFStringRef(description_));
+ IOReturn result = IOPMAssertionCreateWithName(level, kIOPMAssertionLevelOn,
+ cf_description, &assertion_);
LOG_IF(ERROR, result != kIOReturnSuccess)
<< "IOPMAssertionCreate: " << result;
}
@@ -98,8 +98,9 @@ void PowerSaveBlockerImpl::Delegate::RemoveBlock() {
}
PowerSaveBlockerImpl::PowerSaveBlockerImpl(PowerSaveBlockerType type,
- const std::string& reason)
- : delegate_(new Delegate(type, reason)) {
+ Reason reason,
+ const std::string& description)
+ : delegate_(new Delegate(type, description)) {
g_power_thread.Pointer()->message_loop()->PostTask(
FROM_HERE,
base::Bind(&Delegate::ApplyBlock, delegate_));
« no previous file with comments | « content/browser/power_save_blocker_impl.cc ('k') | content/browser/power_save_blocker_ozone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698