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

Unified Diff: content/browser/power_save_blocker_x11.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_win.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/power_save_blocker_x11.cc
diff --git a/content/browser/power_save_blocker_x11.cc b/content/browser/power_save_blocker_x11.cc
index f1d028c7f459e51bbc234af18050b3095b9b7618..58e1e49990b17071b692bae11360afe84789dc59 100644
--- a/content/browser/power_save_blocker_x11.cc
+++ b/content/browser/power_save_blocker_x11.cc
@@ -67,7 +67,7 @@ class PowerSaveBlockerImpl::Delegate
: public base::RefCountedThreadSafe<PowerSaveBlockerImpl::Delegate> {
public:
// Picks an appropriate D-Bus API to use based on the desktop environment.
- Delegate(PowerSaveBlockerType type, const std::string& reason);
+ Delegate(PowerSaveBlockerType type, const std::string& description);
// Post a task to initialize the delegate on the UI thread, which will itself
// then post a task to apply the power save block on the FILE thread.
@@ -104,7 +104,7 @@ class PowerSaveBlockerImpl::Delegate
static DBusAPI SelectAPI();
const PowerSaveBlockerType type_;
- const std::string reason_;
+ const std::string description_;
// Initially, we post a message to the UI thread to select an API. When it
// finishes, it will post a message to the FILE thread to perform the actual
@@ -125,9 +125,9 @@ class PowerSaveBlockerImpl::Delegate
};
PowerSaveBlockerImpl::Delegate::Delegate(PowerSaveBlockerType type,
- const std::string& reason)
+ const std::string& description)
: type_(type),
- reason_(reason),
+ description_(description),
api_(NO_API),
enqueue_apply_(false),
inhibit_cookie_(0) {
@@ -202,7 +202,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) {
message_writer->AppendString(
base::CommandLine::ForCurrentProcess()->GetProgram().value());
message_writer->AppendUint32(0); // should be toplevel_xid
- message_writer->AppendString(reason_);
+ message_writer->AppendString(description_);
{
uint32 flags = 0;
switch (type_) {
@@ -229,7 +229,7 @@ void PowerSaveBlockerImpl::Delegate::ApplyBlock(DBusAPI api) {
// reason: The reason for the inhibit
message_writer->AppendString(
base::CommandLine::ForCurrentProcess()->GetProgram().value());
- message_writer->AppendString(reason_);
+ message_writer->AppendString(description_);
break;
}
@@ -325,9 +325,10 @@ DBusAPI PowerSaveBlockerImpl::Delegate::SelectAPI() {
return NO_API;
}
-PowerSaveBlockerImpl::PowerSaveBlockerImpl(
- PowerSaveBlockerType type, const std::string& reason)
- : delegate_(new Delegate(type, reason)) {
+PowerSaveBlockerImpl::PowerSaveBlockerImpl(PowerSaveBlockerType type,
+ Reason reason,
+ const std::string& description)
+ : delegate_(new Delegate(type, description)) {
delegate_->Init();
}
« no previous file with comments | « content/browser/power_save_blocker_win.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698