OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 ScreenWakeLock_h | |
6 #define ScreenWakeLock_h | |
7 | |
8 #include "core/frame/LocalFrameLifecycleObserver.h" | |
9 #include "core/page/PageLifecycleObserver.h" | |
10 #include "modules/ModulesExport.h" | |
11 #include "wtf/Noncopyable.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class LocalFrame; | |
16 class Screen; | |
17 class WebWakeLockClient; | |
18 | |
19 class MODULES_EXPORT ScreenWakeLock final | |
jochen (gone - plz use gerrit)
2015/07/24 11:25:43
all the inherited stuff on one line please, there'
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
20 : public NoBaseWillBeGarbageCollected<ScreenWakeLock> | |
21 , public WillBeHeapSupplement<LocalFrame> | |
sof
2015/07/24 12:01:51
Question: ScreenWakeLock.idl is defined to be a Sc
| |
22 , PageLifecycleObserver | |
jochen (gone - plz use gerrit)
2015/07/24 11:25:43
always add public
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
23 , LocalFrameLifecycleObserver { | |
24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenWakeLock); | |
jochen (gone - plz use gerrit)
2015/07/24 11:25:43
why WILL_BE? modules are already in oilpan
sof
2015/07/24 12:01:51
A bit confusing, but WILL_BE is relative to LocalF
| |
25 WTF_MAKE_NONCOPYABLE(ScreenWakeLock); | |
26 public: | |
27 // IDL-bound functions | |
mlamouri (slow - plz ping)
2015/07/24 10:47:57
nit: we usually don't add that kind of comments.
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
28 static bool keepAwake(Screen&); | |
29 static void setKeepAwake(Screen&, bool); | |
30 | |
31 bool keepAwake() const { return m_keepAwake; } | |
32 void setKeepAwake(bool); | |
33 | |
34 static const char* supplementName(); | |
35 static ScreenWakeLock* from(LocalFrame*); | |
36 static void provideTo(LocalFrame&, WebWakeLockClient*); | |
37 | |
38 // Inherited from PageLifecycleObserver | |
mlamouri (slow - plz ping)
2015/07/24 10:47:57
nit: period at the end of the sentence.
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
39 virtual void pageVisibilityChanged() override; | |
40 virtual void didCommitLoad(LocalFrame*) override; | |
sof
2015/07/24 12:01:51
Blink is now aligned with http://code.google.com/p
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
41 | |
42 // Inherited from LocalFrameLifecycleObserver | |
mlamouri (slow - plz ping)
2015/07/24 10:47:57
ditto.
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
43 virtual void willDetachFrameHost() override; | |
44 | |
45 DECLARE_VIRTUAL_TRACE(); | |
46 | |
47 private: | |
48 ScreenWakeLock(LocalFrame&, WebWakeLockClient*); | |
49 | |
50 static ScreenWakeLock* fromScreen(Screen&); | |
51 void notifyClient(); | |
52 | |
53 bool m_keepAwake; | |
54 WebWakeLockClient* m_client; | |
sof
2015/07/24 12:01:51
nit: have m_keepAwake last.
alogvinov
2015/07/24 13:36:01
Acknowledged.
| |
55 }; | |
56 | |
57 } // namespace blink | |
58 | |
59 #endif // ScreenWakeLock_h | |
OLD | NEW |