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

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

Issue 1893983002: Simplify handling of Transferable objects while (de)serializing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove Transferable.cpp, not needed after all. 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
new file mode 100644
index 0000000000000000000000000000000000000000..bec7fc0cf134378dd5717888d778f112999fa09a
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/core/v8/Transferables.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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 Transferables_h
+#define Transferables_h
+
+#include "core/CoreExport.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class DOMArrayBufferBase;
+class ImageBitmap;
+class MessagePort;
+
+using ArrayBufferArray = HeapVector<Member<DOMArrayBufferBase>>;
+using ImageBitmapArray = HeapVector<Member<ImageBitmap>>;
+using MessagePortArray = HeapVector<Member<MessagePort>>;
+
+class CORE_EXPORT Transferables final {
xidachen 2016/04/18 12:13:13 Question: With this class under core/ and marked
sof 2016/04/18 18:28:01 If you want to have such a thing, and it otherwise
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(Transferables);
+public:
+ Transferables()
+ {
+ }
+
+ ArrayBufferArray arrayBuffers;
+ ImageBitmapArray imageBitmaps;
+ MessagePortArray messagePorts;
+};
+
+// Along with extending |Transferables| to hold a new kind of transferable
+// objects, serialization handling code changes are required:
+// - extend ScriptValueSerializer::copyTransferables()
+// - alter SerializedScriptValue(Factory) to do the actual transfer.
+
+} // namespace blink
+
+#endif // Transferables_h

Powered by Google App Engine
This is Rietveld 408576698