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

Unified Diff: Source/modules/serviceworkers/StashedPortCollection.h

Issue 1008533005: Initial implementation of stashed message ports, blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 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/serviceworkers/StashedPortCollection.h
diff --git a/Source/modules/serviceworkers/StashedPortCollection.h b/Source/modules/serviceworkers/StashedPortCollection.h
new file mode 100644
index 0000000000000000000000000000000000000000..c60c0f54ec9dd1fe3002e36b86a781173e3d60e1
--- /dev/null
+++ b/Source/modules/serviceworkers/StashedPortCollection.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 StashedPortCollection_h
+#define StashedPortCollection_h
+
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
+#include "modules/serviceworkers/StashedMessagePort.h"
+#include "wtf/RefCounted.h"
+
+namespace blink {
+class ScriptState;
+class ScriptValue;
+class ServiceWorkerGlobalScope;
+
+class StashedPortCollection final
+ : public EventTargetWithInlineData
+ , public RefCountedWillBeNoBase<StashedPortCollection>
+ , public ContextLifecycleObserver {
+ DEFINE_WRAPPERTYPEINFO();
+ REFCOUNTED_EVENT_TARGET(StashedPortCollection);
+ WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(StashedPortCollection);
+ WTF_MAKE_NONCOPYABLE(StashedPortCollection);
+public:
+ static PassRefPtrWillBeRawPtr<StashedPortCollection> create(ExecutionContext*);
+ virtual ~StashedPortCollection();
+
+ void addPorts(const StashedMessagePortArray&);
+
+ // StashedPortCollection.idl
+ PassRefPtrWillBeRawPtr<StashedMessagePort> add(ScriptState*, const String& name, MessagePort*);
+
+ // EventTarget overrides.
+ const AtomicString& interfaceName() const override;
+ ExecutionContext* executionContext() const override;
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(message);
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ explicit StashedPortCollection(ExecutionContext*);
+
+ StashedMessagePortArray m_ports;
+};
+
+} // namespace blink
+
+#endif // StashedPortCollection_h
« no previous file with comments | « Source/modules/serviceworkers/StashedMessagePort.idl ('k') | Source/modules/serviceworkers/StashedPortCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698