OLD | NEW |
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 StashedPortCollection_h | 5 #ifndef StashedPortCollection_h |
6 #define StashedPortCollection_h | 6 #define StashedPortCollection_h |
7 | 7 |
8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
10 #include "modules/ModulesExport.h" | 10 #include "modules/ModulesExport.h" |
11 #include "modules/serviceworkers/StashedMessagePort.h" | 11 #include "modules/serviceworkers/StashedMessagePort.h" |
12 #include "wtf/RefCounted.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "wtf/Forward.h" |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 class ScriptState; | 16 class ScriptState; |
16 class ScriptValue; | |
17 class ServiceWorkerGlobalScope; | |
18 | 17 |
19 class MODULES_EXPORT StashedPortCollection final | 18 class MODULES_EXPORT StashedPortCollection final |
20 : public EventTargetWithInlineData | 19 : public RefCountedGarbageCollectedEventTargetWithInlineData<StashedPortColl
ection> |
21 , public RefCountedWillBeNoBase<StashedPortCollection> | |
22 , public ContextLifecycleObserver { | 20 , public ContextLifecycleObserver { |
23 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
24 REFCOUNTED_EVENT_TARGET(StashedPortCollection); | 22 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(StashedPortCollection); |
25 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StashedPortCollection); | 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StashedPortCollection); |
26 WTF_MAKE_NONCOPYABLE(StashedPortCollection); | 24 WTF_MAKE_NONCOPYABLE(StashedPortCollection); |
27 public: | 25 public: |
28 static PassRefPtrWillBeRawPtr<StashedPortCollection> create(ExecutionContext
*); | 26 static StashedPortCollection* create(ExecutionContext*); |
29 virtual ~StashedPortCollection(); | 27 virtual ~StashedPortCollection(); |
30 | 28 |
31 void addPorts(const StashedMessagePortArray&); | 29 void addPorts(const StashedMessagePortArray&); |
32 | 30 |
33 // StashedPortCollection.idl | 31 // StashedPortCollection.idl |
34 PassRefPtrWillBeRawPtr<StashedMessagePort> add(ScriptState*, const String& n
ame, MessagePort*); | 32 PassRefPtrWillBeRawPtr<StashedMessagePort> add(ScriptState*, const String& n
ame, MessagePort*); |
35 | 33 |
36 // EventTarget overrides. | 34 // EventTarget overrides. |
37 const AtomicString& interfaceName() const override; | 35 const AtomicString& interfaceName() const override; |
38 ExecutionContext* executionContext() const override; | 36 ExecutionContext* executionContext() const override; |
39 | 37 |
40 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 38 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
41 | 39 |
42 DECLARE_VIRTUAL_TRACE(); | 40 DECLARE_VIRTUAL_TRACE(); |
43 | 41 |
44 private: | 42 private: |
45 explicit StashedPortCollection(ExecutionContext*); | 43 explicit StashedPortCollection(ExecutionContext*); |
46 | 44 |
47 StashedMessagePortArray m_ports; | 45 StashedMessagePortArray m_ports; |
48 }; | 46 }; |
49 | 47 |
50 } // namespace blink | 48 } // namespace blink |
51 | 49 |
52 #endif // StashedPortCollection_h | 50 #endif // StashedPortCollection_h |
OLD | NEW |