Chromium Code Reviews| Index: Source/modules/navigatorconnect/ServicePortCollection.h |
| diff --git a/Source/modules/navigatorconnect/ServicePortCollection.h b/Source/modules/navigatorconnect/ServicePortCollection.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c8f1b7c83f5df0ae2311b3a87333368fdbe4ec22 |
| --- /dev/null |
| +++ b/Source/modules/navigatorconnect/ServicePortCollection.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ServicePortCollection_h |
| +#define ServicePortCollection_h |
| + |
| +#include "bindings/core/v8/ScriptPromise.h" |
| +#include "core/dom/ContextLifecycleObserver.h" |
| +#include "core/events/EventTarget.h" |
| +#include "modules/ModulesExport.h" |
| +#include "wtf/RefCounted.h" |
| + |
| +namespace blink { |
| + |
| +class ServicePortConnectOptions; |
| +class ServicePortMatchOptions; |
| + |
| +class MODULES_EXPORT ServicePortCollection final |
|
haraken
2015/06/24 01:18:46
Nit: We can move this to Oilpan's heap. The oilpan
|
| + : public EventTargetWithInlineData |
| + , public RefCountedWillBeNoBase<ServicePortCollection> |
| + , public ContextLifecycleObserver { |
| + DEFINE_WRAPPERTYPEINFO(); |
| + REFCOUNTED_EVENT_TARGET(ServicePortCollection); |
| + WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ServicePortCollection); |
| + WTF_MAKE_NONCOPYABLE(ServicePortCollection); |
| +public: |
| + static PassRefPtrWillBeRawPtr<ServicePortCollection> create(ExecutionContext*); |
| + ~ServicePortCollection() override; |
| + |
| + // ServicePortCollection.idl |
| + ScriptPromise connect(ScriptState*, const String& url, const ServicePortConnectOptions&); |
| + ScriptPromise match(ScriptState*, const ServicePortMatchOptions&); |
| + ScriptPromise matchAll(ScriptState*, const ServicePortMatchOptions&); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(connect); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| + DEFINE_ATTRIBUTE_EVENT_LISTENER(close); |
| + |
| + // EventTarget overrides. |
| + const AtomicString& interfaceName() const override; |
| + ExecutionContext* executionContext() const override; |
| + |
| + DECLARE_VIRTUAL_TRACE(); |
| + |
| +private: |
| + explicit ServicePortCollection(ExecutionContext*); |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // ServicePortCollection_h |