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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationAvailability.h

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PresentationAvailability_h 5 #ifndef PresentationAvailability_h
6 #define PresentationAvailability_h 6 #define PresentationAvailability_h
7 7
8 #include "core/dom/ActiveDOMObject.h" 8 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h" 9 #include "core/events/EventTarget.h"
10 #include "core/page/PageLifecycleObserver.h" 10 #include "core/page/PageLifecycleObserver.h"
(...skipping 10 matching lines...) Expand all
21 // Expose whether there is a presentation display available for |url|. The 21 // Expose whether there is a presentation display available for |url|. The
22 // object will be initialized with a default value passed via ::take() and will 22 // object will be initialized with a default value passed via ::take() and will
23 // then subscribe to receive callbacks if the status for |url| were to 23 // then subscribe to receive callbacks if the status for |url| were to
24 // change. The object will only listen to changes when required. 24 // change. The object will only listen to changes when required.
25 class MODULES_EXPORT PresentationAvailability final 25 class MODULES_EXPORT PresentationAvailability final
26 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAva ilability> 26 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAva ilability>
27 , public ActiveDOMObject 27 , public ActiveDOMObject
28 , public PageLifecycleObserver 28 , public PageLifecycleObserver
29 , public WebPresentationAvailabilityObserver { 29 , public WebPresentationAvailabilityObserver {
30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability); 30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability);
31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); 31 USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability);
32 DEFINE_WRAPPERTYPEINFO(); 32 DEFINE_WRAPPERTYPEINFO();
33 public: 33 public:
34 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b ool); 34 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b ool);
35 ~PresentationAvailability() override; 35 ~PresentationAvailability() override;
36 36
37 // EventTarget implementation. 37 // EventTarget implementation.
38 const AtomicString& interfaceName() const override; 38 const AtomicString& interfaceName() const override;
39 ExecutionContext* executionContext() const override; 39 ExecutionContext* executionContext() const override;
40 40
41 // WebPresentationAvailabilityObserver implementation. 41 // WebPresentationAvailabilityObserver implementation.
(...skipping 10 matching lines...) Expand all
52 void pageVisibilityChanged() override; 52 void pageVisibilityChanged() override;
53 53
54 bool value() const; 54 bool value() const;
55 55
56 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); 56 DEFINE_ATTRIBUTE_EVENT_LISTENER(change);
57 57
58 DECLARE_VIRTUAL_TRACE(); 58 DECLARE_VIRTUAL_TRACE();
59 59
60 protected: 60 protected:
61 // EventTarget implementation. 61 // EventTarget implementation.
62 bool addEventListenerInternal(const AtomicString& eventType, PassRefPtrWillB eRawPtr<EventListener>, const EventListenerOptions&) override; 62 bool addEventListenerInternal(const AtomicString& eventType, RawPtr<EventLis tener>, const EventListenerOptions&) override;
63 63
64 private: 64 private:
65 // Current state of the ActiveDOMObject. It is Active when created. It 65 // Current state of the ActiveDOMObject. It is Active when created. It
66 // becomes Suspended when suspend() is called and moves back to Active if 66 // becomes Suspended when suspend() is called and moves back to Active if
67 // resume() is called. It becomes Inactive when stop() is called or at 67 // resume() is called. It becomes Inactive when stop() is called or at
68 // destruction time. 68 // destruction time.
69 enum class State : char { 69 enum class State : char {
70 Active, 70 Active,
71 Suspended, 71 Suspended,
72 Inactive, 72 Inactive,
73 }; 73 };
74 74
75 PresentationAvailability(ExecutionContext*, const KURL&, bool); 75 PresentationAvailability(ExecutionContext*, const KURL&, bool);
76 76
77 void setState(State); 77 void setState(State);
78 void updateListening(); 78 void updateListening();
79 79
80 const KURL m_url; 80 const KURL m_url;
81 bool m_value; 81 bool m_value;
82 State m_state; 82 State m_state;
83 }; 83 };
84 84
85 } // namespace blink 85 } // namespace blink
86 86
87 #endif // PresentationAvailability_h 87 #endif // PresentationAvailability_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698