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

Unified Diff: third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h

Issue 1794553002: [Playground] Onion Soup: moving ScreenWakeLock to Blink modules/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit DEPS Created 4 years, 8 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: third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
diff --git a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
index ea9ee36a9e0be1043ed64855793f486d6bfc2fb2..e319143530627fc91271b5fc75d7e2274477b183 100644
--- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
+++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
@@ -8,27 +8,28 @@
#include "core/frame/LocalFrameLifecycleObserver.h"
#include "core/page/PageLifecycleObserver.h"
#include "modules/ModulesExport.h"
+#include "public/platform/modules/wake_lock/wake_lock_service.mojom.h"
#include "wtf/Noncopyable.h"
namespace blink {
class LocalFrame;
class Screen;
-class WebWakeLockClient;
+class ServiceRegistry;
-class MODULES_EXPORT ScreenWakeLock final : public GarbageCollected<ScreenWakeLock>, public Supplement<LocalFrame>, public PageLifecycleObserver, public LocalFrameLifecycleObserver {
+class MODULES_EXPORT ScreenWakeLock final : public GarbageCollectedFinalized<ScreenWakeLock>, public Supplement<LocalFrame>, public PageLifecycleObserver, public LocalFrameLifecycleObserver {
USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock);
WTF_MAKE_NONCOPYABLE(ScreenWakeLock);
public:
+ static RawPtr<ScreenWakeLock> create(LocalFrame&, ServiceRegistry*);
+
static bool keepAwake(Screen&);
static void setKeepAwake(Screen&, bool);
- bool keepAwake() const { return m_keepAwake; }
- void setKeepAwake(bool);
-
static const char* supplementName();
static ScreenWakeLock* from(LocalFrame*);
- static void provideTo(LocalFrame&, WebWakeLockClient*);
+
+ ~ScreenWakeLock() = default;
// Inherited from PageLifecycleObserver.
void pageVisibilityChanged() override;
@@ -40,15 +41,20 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
- ScreenWakeLock(LocalFrame&, WebWakeLockClient*);
+ ScreenWakeLock(LocalFrame&, ServiceRegistry*);
+
+ bool keepAwake() const;
+ void setKeepAwake(bool);
static ScreenWakeLock* fromScreen(Screen&);
void notifyClient();
- WebWakeLockClient* m_client;
+ mojom::WakeLockServicePtr m_service;
bool m_keepAwake;
};
+MODULES_EXPORT void provideScreenWakeLockTo(LocalFrame&, ServiceRegistry*);
+
} // namespace blink
#endif // ScreenWakeLock_h
« no previous file with comments | « third_party/WebKit/Source/modules/wake_lock/OWNERS ('k') | third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698