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

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

Issue 1805843002: [v8 gc] Introduce a base class for all objects that can have pending activity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 4 years, 9 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 "bindings/core/v8/V8GCRoot.h"
8 #include "core/dom/ActiveDOMObject.h" 9 #include "core/dom/ActiveDOMObject.h"
9 #include "core/events/EventTarget.h" 10 #include "core/events/EventTarget.h"
10 #include "core/page/PageLifecycleObserver.h" 11 #include "core/page/PageLifecycleObserver.h"
11 #include "modules/ModulesExport.h" 12 #include "modules/ModulesExport.h"
12 #include "platform/weborigin/KURL.h" 13 #include "platform/weborigin/KURL.h"
13 #include "public/platform/WebURL.h" 14 #include "public/platform/WebURL.h"
14 #include "public/platform/modules/presentation/WebPresentationAvailabilityObserv er.h" 15 #include "public/platform/modules/presentation/WebPresentationAvailabilityObserv er.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 class ExecutionContext; 19 class ExecutionContext;
19 class ScriptPromiseResolver; 20 class ScriptPromiseResolver;
20 21
21 // Expose whether there is a presentation display available for |url|. The 22 // 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 23 // 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 24 // then subscribe to receive callbacks if the status for |url| were to
24 // change. The object will only listen to changes when required. 25 // change. The object will only listen to changes when required.
25 class MODULES_EXPORT PresentationAvailability final 26 class MODULES_EXPORT PresentationAvailability final
26 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAva ilability> 27 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationAva ilability>
27 , public ActiveDOMObject 28 , public ActiveDOMObject
28 , public PageLifecycleObserver 29 , public PageLifecycleObserver
29 , public WebPresentationAvailabilityObserver { 30 , public WebPresentationAvailabilityObserver
31 , public V8GCRoot {
30 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability); 32 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(PresentationAvailability);
31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability); 33 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationAvailability);
32 DEFINE_WRAPPERTYPEINFO(); 34 DEFINE_WRAPPERTYPEINFO();
33 public: 35 public:
34 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b ool); 36 static PresentationAvailability* take(ScriptPromiseResolver*, const KURL&, b ool);
35 ~PresentationAvailability() override; 37 ~PresentationAvailability() override;
36 38
37 // EventTarget implementation. 39 // EventTarget implementation.
38 const AtomicString& interfaceName() const override; 40 const AtomicString& interfaceName() const override;
39 ExecutionContext* getExecutionContext() const override; 41 ExecutionContext* getExecutionContext() const override;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void updateListening(); 80 void updateListening();
79 81
80 const KURL m_url; 82 const KURL m_url;
81 bool m_value; 83 bool m_value;
82 State m_state; 84 State m_state;
83 }; 85 };
84 86
85 } // namespace blink 87 } // namespace blink
86 88
87 #endif // PresentationAvailability_h 89 #endif // PresentationAvailability_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698