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