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

Unified Diff: Source/modules/wake_lock/NavigatorWakeLock.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/NavigatorWakeLock.h
diff --git a/Source/modules/wake_lock/NavigatorWakeLock.h b/Source/modules/wake_lock/NavigatorWakeLock.h
new file mode 100644
index 0000000000000000000000000000000000000000..7714c15410cbc6f7ce894dd799af80deb43c82fc
--- /dev/null
+++ b/Source/modules/wake_lock/NavigatorWakeLock.h
@@ -0,0 +1,42 @@
+// 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 NavigatorWakeLock_h
+#define NavigatorWakeLock_h
+
+#include "core/frame/DOMWindowProperty.h"
+#include "platform/Supplementable.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class LocalFrame;
+class Navigator;
+class WakeLock;
+
+class NavigatorWakeLock FINAL
+ : public NoBaseWillBeGarbageCollectedFinalized<NavigatorWakeLock>
+ , public WillBeHeapSupplement<Navigator>
+ , public DOMWindowProperty {
mlamouri (slow - plz ping) 2014/08/18 12:15:52 I think you should be able to not depend on DOMWin
redchenko 2014/08/19 16:42:20 Done.
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NavigatorWakeLock);
+
mlamouri (slow - plz ping) 2014/08/18 12:15:52 nit: remove this empty line.
redchenko 2014/08/19 16:42:20 Done.
+public:
+ virtual ~NavigatorWakeLock();
+ static NavigatorWakeLock& from(Navigator&);
+
+ static WakeLock* wakeLock(Navigator&);
+ WakeLock* wakeLock() const;
+
+ void trace(Visitor*);
+
+private:
+ NavigatorWakeLock(LocalFrame*);
mlamouri (slow - plz ping) 2014/08/18 12:15:52 I think this should be NavigatorWakeLock(). But if
redchenko 2014/08/19 16:42:20 Done.
+ static const char* supplementName();
+
+ mutable RefPtrWillBeMember<WakeLock> m_wakeLock;
mlamouri (slow - plz ping) 2014/08/18 12:15:52 Why is m_wakeLock mutable? If you have a good reas
redchenko 2014/08/19 16:42:20 Done.
+};
+
+} // namespace WebCore
+
+#endif // NavigatorWakeLock_h

Powered by Google App Engine
This is Rietveld 408576698