OLD | NEW |
(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 |
OLD | NEW |