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

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

Issue 1423513005: Reland of: Make Imagebitmap Transferable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and issue fixing Created 5 years, 1 month 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/SerializedScriptValue.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
index 77658e791ca7533c423bbe245392c66d65752c7f..61ebf720ef2c458cc762dca065309b845d3cd2b4 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
+++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.h
@@ -33,6 +33,7 @@
#include "bindings/core/v8/ScriptValue.h"
#include "core/CoreExport.h"
+#include "third_party/skia/include/core/SkImage.h"
#include "wtf/HashMap.h"
#include "wtf/ThreadSafeRefCounted.h"
#include <v8.h>
@@ -48,6 +49,7 @@ namespace blink {
class BlobDataHandle;
class DOMArrayBufferBase;
class ExceptionState;
+class ImageBitmap;
class MessagePort;
class WebBlobInfo;
@@ -55,6 +57,7 @@ typedef HeapVector<Member<MessagePort>, 1> MessagePortArray;
typedef Vector<RefPtr<DOMArrayBufferBase>, 1> ArrayBufferArray;
typedef HashMap<String, RefPtr<BlobDataHandle>> BlobDataHandleMap;
typedef Vector<WebBlobInfo> WebBlobInfoArray;
+typedef WillBeHeapVector<RefPtrWillBeMember<ImageBitmap>, 1> ImageBitmapArray;
class CORE_EXPORT SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> {
public:
@@ -89,7 +92,7 @@ public:
// Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3
// of the HTML5 spec and generates exceptions as appropriate.
// Returns true if the array was filled, or false if the passed value was not of an appropriate type.
- static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, MessagePortArray&, ArrayBufferArray&, ExceptionState&);
+ static bool extractTransferables(v8::Isolate*, v8::Local<v8::Value>, int, MessagePortArray&, ArrayBufferArray&, ImageBitmapArray&, ExceptionState&);
// Informs the V8 about external memory allocated and owned by this object. Large values should contribute
// to GC counters to eventually trigger a GC, otherwise flood of postMessage() can cause OOM.
@@ -107,6 +110,7 @@ private:
WireData
};
typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray;
+ typedef Vector<RefPtr<SkImage>, 1> ImageBitmapContentsArray;
SerializedScriptValue();
explicit SerializedScriptValue(const String& wireData);
@@ -115,13 +119,17 @@ private:
String& data() { return m_data; }
void setData(const String& data) { m_data = data; }
void transferArrayBuffers(v8::Isolate*, ArrayBufferArray&, ExceptionState&);
+ void transferImageBitmaps(v8::Isolate*, ImageBitmapArray&, ExceptionState&);
ArrayBufferContentsArray* arrayBufferContentsArray() { return m_arrayBufferContentsArray.get(); }
+ ImageBitmapContentsArray* imageBitmapContentsArray() { return m_imageBitmapContentsArray.get(); }
static PassOwnPtr<ArrayBufferContentsArray> createArrayBuffers(v8::Isolate*, ArrayBufferArray&, ExceptionState&);
+ static PassOwnPtr<ImageBitmapContentsArray> createImageBitmaps(v8::Isolate*, ImageBitmapArray&, ExceptionState&);
private:
String m_data;
OwnPtr<ArrayBufferContentsArray> m_arrayBufferContentsArray;
+ OwnPtr<ImageBitmapContentsArray> m_imageBitmapContentsArray;
BlobDataHandleMap m_blobDataHandles;
intptr_t m_externallyAllocatedMemory;

Powered by Google App Engine
This is Rietveld 408576698