| 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
|
|
|