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

Unified Diff: content/browser/wake_lock/lock.h

Issue 406483004: Initial implementation of API WakeLock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
Index: content/browser/wake_lock/lock.h
diff --git a/content/browser/wake_lock/lock.h b/content/browser/wake_lock/lock.h
new file mode 100644
index 0000000000000000000000000000000000000000..fc7e85d9ae3040be50054ea082f5f6b41087d47e
--- /dev/null
+++ b/content/browser/wake_lock/lock.h
@@ -0,0 +1,38 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_WAKE_LOCK_LOCK_H_
+#define CONTENT_BROWSER_WAKE_LOCK_LOCK_H_
+
+#include "content/browser/power_save_blocker_impl.h"
+
+namespace content {
+
+class WakeLockManager;
+
+class Lock {
+ public:
+ Lock(int render_process_id, int routed_id);
+ ~Lock();
+
+ void UnlockResource();
+
+ int GetRenderProcessId() const { return render_process_id_; }
+ int GetRoutedId() const { return routed_id_; }
+
+ friend class WakeLockManager;
+
+ protected:
+ void LockResource();
+ void ForceLockResource();
+ void ForceUnlockResource();
+
+ int render_process_id_;
+ int routed_id_;
+ bool unlocked_force_;
+ scoped_ptr<PowerSaveBlocker> blocker_;
+};
+}
+
+#endif // CONTENT_BROWSER_WAKE_LOCK_LOCK_H_

Powered by Google App Engine
This is Rietveld 408576698