summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-31 21:31:18 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-31 21:31:18 +0000
commit74346a7a2c1a811d79c360dd5860eb04036f04f9 (patch)
tree01ea09755e0880022e3706745ee0f335b94fb43f
parent49a2a7a519b32cc6cd47c1edeaa73d46b8ca7991 (diff)
downloadchromium_src-74346a7a2c1a811d79c360dd5860eb04036f04f9.zip
chromium_src-74346a7a2c1a811d79c360dd5860eb04036f04f9.tar.gz
chromium_src-74346a7a2c1a811d79c360dd5860eb04036f04f9.tar.bz2
chromeos: Pass suspend-delay description to powerd.
This adds a human-readable description ("chrome") for the suspend delay that Chrome registers with the power manager. BUG=chromium-os:36980 TBR=marcheu@chromium.org Review URL: https://chromiumcodereview.appspot.com/12082103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179964 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chromeos/dbus/power_manager_client.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index 0dfa12b..8b0adb8 100644
--- a/chromeos/dbus/power_manager_client.cc
+++ b/chromeos/dbus/power_manager_client.cc
@@ -28,8 +28,13 @@
namespace chromeos {
+// Maximum amount of time that the power manager will wait for Chrome to
+// say that it's ready for the system to be suspended, in milliseconds.
const int kSuspendDelayTimeoutMs = 5000;
+// Human-readable description of Chrome's suspend delay.
+const char kSuspendDelayDescription[] = "chrome";
+
// The PowerManagerClient implementation used in production.
class PowerManagerClientImpl : public PowerManagerClient {
public:
@@ -125,6 +130,7 @@ class PowerManagerClientImpl : public PowerManagerClient {
base::TimeDelta timeout =
base::TimeDelta::FromMilliseconds(kSuspendDelayTimeoutMs);
protobuf_request.set_timeout(timeout.ToInternalValue());
+ protobuf_request.set_description(kSuspendDelayDescription);
if (!writer.AppendProtoAsArrayOfBytes(protobuf_request)) {
LOG(ERROR) << "Error constructing message for "