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

Side by Side Diff: Source/modules/wake_lock/WakeLock.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 unified diff | Download patch
« no previous file with comments | « Source/modules/wake_lock/NavigatorWakeLock.idl ('k') | Source/modules/wake_lock/WakeLock.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WakeLock_h
6 #define WakeLock_h
7
8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptWrappable.h"
10 #include "core/dom/ActiveDOMObject.h"
11
12 namespace blink {
13
14 class Document;
15 class ExecutionContext;
16 class Navigator;
17 class Page;
18
19 class WakeLock FINAL
20 : public RefCountedWillBeGarbageCollectedFinalized<WakeLock>
21 , public ScriptWrappable
22 , public ActiveDOMObject {
23 public:
24 static PassRefPtrWillBeRawPtr<WakeLock> create(ExecutionContext*);
25 virtual ~WakeLock();
26 void trace(Visitor*) { }
27
28 ScriptPromise request(ScriptState*, const AtomicString& type);
29 ScriptPromise release(ScriptState*, const AtomicString& type);
30 bool isHeld(const AtomicString& type);
31
32 private:
33 explicit WakeLock(ExecutionContext*);
34
35 Document* document() const;
36 Page* page() const;
37 };
38
39 } // namespace blink
40
41 #endif // WakeLock_h
OLDNEW
« no previous file with comments | « Source/modules/wake_lock/NavigatorWakeLock.idl ('k') | Source/modules/wake_lock/WakeLock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698