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

Unified Diff: Source/modules/wake_lock/WakeLockPromiseResolver.h

Issue 399313003: Initial implementation of API WakeLock. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Implementation of WakeLock API on JavaScript side. Created 6 years, 4 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: Source/modules/wake_lock/WakeLockPromiseResolver.h
diff --git a/Source/modules/wake_lock/WakeLockPromiseResolver.h b/Source/modules/wake_lock/WakeLockPromiseResolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..c45bf39a92d19cda9c163207d92f22dad15d4bbb
--- /dev/null
+++ b/Source/modules/wake_lock/WakeLockPromiseResolver.h
@@ -0,0 +1,33 @@
+// Copyright 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 WakeLockPromiseResolver_h
+#define WakeLockPromiseResolver_h
+
+#include "bindings/core/v8/ScriptPromiseResolver.h"
+#include "public/platform/WebWakeLockType.h"
+
+namespace blink {
+
+class WakeLockPromiseResolver {
+public:
+ static PassOwnPtr<WakeLockPromiseResolver> create(ScriptState*, WebWakeLockType);
+
+ void resolve();
+ void reject();
+ ScriptPromise promise();
+ WebWakeLockType type() const { return m_type; }
+ int id() const { return m_id; }
+
+private:
+ WakeLockPromiseResolver(ScriptState*, WebWakeLockType, int);
+
+ RefPtr<ScriptPromiseResolver> m_resolver;
+ const WebWakeLockType m_type;
+ const int m_id;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « Source/modules/wake_lock/WakeLockController.cpp ('k') | Source/modules/wake_lock/WakeLockPromiseResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698