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

Unified Diff: Source/modules/navigatorconnect/ServicePortCollection.h

Issue 1192913003: Start implementing new navigator.connect API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
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..c1eb26ae205c6100a297094c97920d6b0834c2ff
--- /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
+ : 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*);
+ virtual ~ServicePortCollection();
tkent 2015/06/23 23:54:48 nit: remove |virtual|, and add |override|.
Marijn Kruisselbrink 2015/06/24 00:26:52 done
+
+ // 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
« no previous file with comments | « Source/modules/navigatorconnect/NavigatorServices.idl ('k') | Source/modules/navigatorconnect/ServicePortCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698