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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/Transferables.h

Issue 1862033002: Make OffscreenCanvas Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address haraken's comments, need bots to test Created 4 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: third_party/WebKit/Source/bindings/core/v8/Transferables.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/Transferables.h b/third_party/WebKit/Source/bindings/core/v8/Transferables.h
index bec7fc0cf134378dd5717888d778f112999fa09a..b8b4347743d6e90f88d20d62eb296e384fb9d85a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/Transferables.h
+++ b/third_party/WebKit/Source/bindings/core/v8/Transferables.h
@@ -19,17 +19,23 @@ using ArrayBufferArray = HeapVector<Member<DOMArrayBufferBase>>;
using ImageBitmapArray = HeapVector<Member<ImageBitmap>>;
using MessagePortArray = HeapVector<Member<MessagePort>>;
-class CORE_EXPORT Transferables final {
- STACK_ALLOCATED();
+class CORE_EXPORT Transferables : public GarbageCollectedFinalized<Transferables> {
WTF_MAKE_NONCOPYABLE(Transferables);
public:
- Transferables()
- {
- }
+ static Transferables* create() { return s_registeredFactory(); }
+ Transferables() { }
+ virtual ~Transferables() { }
ArrayBufferArray arrayBuffers;
ImageBitmapArray imageBitmaps;
MessagePortArray messagePorts;
+ DECLARE_VIRTUAL_TRACE();
+
+ using Factory = Transferables*(*)();
+ static void registerFactory(Factory f) { s_registeredFactory = f; }
haraken 2016/04/21 00:29:02 f => factory
+
+private:
+ static Factory s_registeredFactory;
};
// Along with extending |Transferables| to hold a new kind of transferable

Powered by Google App Engine
This is Rietveld 408576698