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

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

Issue 1883493003: [OnionSoup] Moving WakeLock Service to Blink (2/2): removing WebWakeLockClient and WakeLockDispatch… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: esprehn@ comments 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..ac121f17f8c832c50b52bd146d468a5c10abddb9 100644
--- a/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
+++ b/third_party/WebKit/Source/modules/wake_lock/ScreenWakeLock.h
@@ -8,27 +8,32 @@
#include "core/frame/LocalFrameLifecycleObserver.h"
#include "core/page/PageLifecycleObserver.h"
#include "modules/ModulesExport.h"
+#include "public/platform/modules/wake_lock/wake_lock_service.mojom-wtf.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 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*);
+ static void provideTo(LocalFrame&, ServiceRegistry*);
+
+ ~ScreenWakeLock() = default;
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ ScreenWakeLock(LocalFrame&, ServiceRegistry*);
// Inherited from PageLifecycleObserver.
void pageVisibilityChanged() override;
@@ -37,15 +42,13 @@ public:
// Inherited from LocalFrameLifecycleObserver.
void willDetachFrameHost() override;
- DECLARE_VIRTUAL_TRACE();
-
-private:
- ScreenWakeLock(LocalFrame&, WebWakeLockClient*);
+ bool keepAwake() const;
+ void setKeepAwake(bool);
static ScreenWakeLock* fromScreen(Screen&);
- void notifyClient();
+ void notifyService();
- WebWakeLockClient* m_client;
+ mojom::wtf::WakeLockServicePtr m_service;
bool m_keepAwake;
};
« no previous file with comments | « third_party/WebKit/Source/modules/BUILD.gn ('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