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

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: override instead of virtual 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..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

Powered by Google App Engine
This is Rietveld 408576698