| 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 ServicePortCollection_h | 5 #ifndef ServicePortCollection_h |
| 6 #define ServicePortCollection_h | 6 #define ServicePortCollection_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "core/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
| 12 #include "platform/heap/Handle.h" |
| 12 #include "public/platform/modules/navigator_services/WebServicePortProvider.h" | 13 #include "public/platform/modules/navigator_services/WebServicePortProvider.h" |
| 13 #include "public/platform/modules/navigator_services/WebServicePortProviderClien
t.h" | 14 #include "public/platform/modules/navigator_services/WebServicePortProviderClien
t.h" |
| 14 #include "wtf/RefCounted.h" | 15 #include "wtf/RefCounted.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class ServicePort; | 19 class ServicePort; |
| 19 class ServicePortConnectOptions; | 20 class ServicePortConnectOptions; |
| 20 class ServicePortMatchOptions; | 21 class ServicePortMatchOptions; |
| 21 | 22 |
| 22 class MODULES_EXPORT ServicePortCollection final | 23 class MODULES_EXPORT ServicePortCollection final |
| 23 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServicePortColl
ection> | 24 : public RefCountedGarbageCollectedEventTargetWithInlineData<ServicePortColl
ection> |
| 24 , public ContextLifecycleObserver | 25 , public ContextLifecycleObserver |
| 25 , public WebServicePortProviderClient { | 26 , public WebServicePortProviderClient { |
| 26 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
| 27 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServicePortCollection); | 28 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(ServicePortCollection); |
| 28 WTF_MAKE_NONCOPYABLE(ServicePortCollection); | 29 WTF_MAKE_NONCOPYABLE(ServicePortCollection); |
| 30 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServicePortCollection); |
| 29 public: | 31 public: |
| 30 static ServicePortCollection* create(ExecutionContext*); | 32 static ServicePortCollection* create(ExecutionContext*); |
| 31 ~ServicePortCollection() override; | 33 ~ServicePortCollection() override; |
| 32 | 34 |
| 33 // Adds a port to this collection to keep track of it and allow delivering | 35 // Adds a port to this collection to keep track of it and allow delivering |
| 34 // events related to it. | 36 // events related to it. |
| 35 void addPort(ServicePort*); | 37 void addPort(ServicePort*); |
| 36 | 38 |
| 37 // Called when a port is closed to signal the WebServicePortProvider as well | 39 // Called when a port is closed to signal the WebServicePortProvider as well |
| 38 // as remove the port from this collection. | 40 // as remove the port from this collection. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 60 private: | 62 private: |
| 61 explicit ServicePortCollection(ExecutionContext*); | 63 explicit ServicePortCollection(ExecutionContext*); |
| 62 | 64 |
| 63 OwnPtr<WebServicePortProvider> m_provider; | 65 OwnPtr<WebServicePortProvider> m_provider; |
| 64 HeapVector<Member<ServicePort>> m_ports; | 66 HeapVector<Member<ServicePort>> m_ports; |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace blink | 69 } // namespace blink |
| 68 | 70 |
| 69 #endif // ServicePortCollection_h | 71 #endif // ServicePortCollection_h |
| OLD | NEW |