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

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

Issue 1008533005: Initial implementation of stashed message ports, blink side (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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/StashedMessagePort.h
diff --git a/Source/modules/serviceworkers/StashedMessagePort.h b/Source/modules/serviceworkers/StashedMessagePort.h
new file mode 100644
index 0000000000000000000000000000000000000000..21f1a7a95de91fcdc5a4bff6494c1ba746f2dfef
--- /dev/null
+++ b/Source/modules/serviceworkers/StashedMessagePort.h
@@ -0,0 +1,42 @@
+// 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;
+
+typedef WillBeHeapVector<RefPtrWillBeMember<StashedMessagePort>, 1> StashedMessagePortArray;
+
+class StashedMessagePort final
scheib 2015/05/06 21:44:31 Class comment
Marijn Kruisselbrink 2015/05/12 06:56:40 Done.
+ : public MessagePort {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static PassRefPtrWillBeRawPtr<StashedMessagePort> create(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name);
+ virtual ~StashedMessagePort();
+
+ static PassOwnPtrWillBeRawPtr<StashedMessagePortArray> toStashedMessagePortArray(ExecutionContext*, const WebMessagePortChannelArray&, const WebVector<WebString>& channelKeys);
+
+ String name() const;
scheib 2015/05/06 21:44:31 // StashedMessagePort.idl
Marijn Kruisselbrink 2015/05/12 06:56:40 Done.
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ void messageAvailable() override;
+ void dispatchMessages();
+
+ explicit StashedMessagePort(ExecutionContext&, PassOwnPtr<WebMessagePortChannel>, const String& name);
+
+ WeakPtrFactory<StashedMessagePort> m_weakFactory;
scheib 2015/05/06 21:44:30 WeakPtrFactory best practice is as last member to
Marijn Kruisselbrink 2015/05/12 06:56:41 Done.
+ String m_name;
+};
+
+} // namespace blink
+
+#endif // StashedMessagePort_h

Powered by Google App Engine
This is Rietveld 408576698