Index: Source/modules/serviceworkers/StashedMessagePort.h |
diff --git a/Source/modules/serviceworkers/StashedMessagePort.h b/Source/modules/serviceworkers/StashedMessagePort.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d096868705f47afcc7714bdc14ec342e0ed0be17 |
--- /dev/null |
+++ b/Source/modules/serviceworkers/StashedMessagePort.h |
@@ -0,0 +1,45 @@ |
+// 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 StashedMessagePort_h |
+#define StashedMessagePort_h |
+ |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "core/dom/MessagePort.h" |
+ |
+namespace blink { |
+class ExecutionContext; |
+class StashedMessagePort; |
+ |
+using StashedMessagePortArray = WillBeHeapVector<RefPtrWillBeMember<StashedMessagePort>, 1>; |
jochen (gone - plz use gerrit)
2015/05/15 15:25:03
aren't modules already on oilpan, so you don't nee
Marijn Kruisselbrink
2015/05/18 18:29:35
But StashedMessagePort inherits from MessagePort,
|
+ |
+// Represents a message port that has been stashed. Overrides messageAvailable |
+// to dispatch messages as a global event instead of as events on this port. |
+class StashedMessagePort final |
+ : public MessagePort { |
jochen (gone - plz use gerrit)
2015/05/15 15:25:03
nit. on previous line
Marijn Kruisselbrink
2015/05/18 18:29:35
Done
|
+ DEFINE_WRAPPERTYPEINFO(); |
jochen (gone - plz use gerrit)
2015/05/15 15:25:03
WTF_MAKE_NONCOPYABLE?
Marijn Kruisselbrink
2015/05/18 18:29:35
Done
|
+public: |
+ static PassRefPtrWillBeRawPtr<StashedMessagePort> create(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name); |
+ virtual ~StashedMessagePort(); |
+ |
+ static PassOwnPtrWillBeRawPtr<StashedMessagePortArray> toStashedMessagePortArray(ExecutionContext*, const WebMessagePortChannelArray&, const WebVector<WebString>& channelKeys); |
+ |
+ // StashedMessagePort.idl |
+ String name() const; |
+ |
+ DEFINE_INLINE_VIRTUAL_TRACE() { MessagePort::trace(visitor); } |
+ |
+private: |
+ void messageAvailable() override; |
+ void dispatchMessages(); |
+ |
+ explicit StashedMessagePort(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name); |
jochen (gone - plz use gerrit)
2015/05/15 15:25:03
no explicit, should also come before other private
Marijn Kruisselbrink
2015/05/18 18:29:35
Done
|
+ |
+ String m_name; |
+ WeakPtrFactory<StashedMessagePort> m_weakFactory; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // StashedMessagePort_h |