| Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
|
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
|
| index 060b2afd7f00bad792ac3e95e35d2401858f1b68..d5ad88de6d5d6e77743f2578e3f023fefb26bdb8 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h
|
| @@ -9,6 +9,7 @@
|
| #include "bindings/core/v8/SerializedScriptValue.h"
|
| #include "bindings/core/v8/V8Binding.h"
|
| #include "core/CoreExport.h"
|
| +#include "third_party/skia/include/core/SkImage.h"
|
| #include "wtf/ArrayBufferContents.h"
|
| #include "wtf/HashMap.h"
|
| #include "wtf/Noncopyable.h"
|
| @@ -26,6 +27,7 @@ class File;
|
| class FileList;
|
|
|
| typedef Vector<WTF::ArrayBufferContents, 1> ArrayBufferContentsArray;
|
| +typedef Vector<RefPtr<SkImage>, 1> ImageBitmapContentsArray;
|
|
|
| // V8ObjectMap is a map from V8 objects to arbitrary values of type T.
|
| // V8 objects (or handles to V8 objects) cannot be used as keys in ordinary wtf::HashMaps;
|
| @@ -137,6 +139,7 @@ public:
|
| void writeRegExp(v8::Local<v8::String> pattern, v8::RegExp::Flags);
|
| void writeTransferredMessagePort(uint32_t index);
|
| void writeTransferredArrayBuffer(uint32_t index);
|
| + void writeTransferredImageBitmap(uint32_t index);
|
| void writeTransferredSharedArrayBuffer(uint32_t index);
|
| void writeObjectReference(uint32_t reference);
|
| void writeObject(uint32_t numProperties);
|
| @@ -202,7 +205,7 @@ public:
|
| JSException
|
| };
|
|
|
| - ScriptValueSerializer(SerializedScriptValueWriter&, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, WebBlobInfoArray*, BlobDataHandleMap& blobDataHandles, v8::TryCatch&, ScriptState*);
|
| + ScriptValueSerializer(SerializedScriptValueWriter&, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, ImageBitmapArray* imageBitmaps, WebBlobInfoArray*, BlobDataHandleMap& blobDataHandles, v8::TryCatch&, ScriptState*);
|
| v8::Isolate* isolate() { return m_scriptState->isolate(); }
|
| v8::Local<v8::Context> context() { return m_scriptState->context(); }
|
|
|
| @@ -401,6 +404,7 @@ private:
|
| StateBase* writeAndGreyArrayBufferView(v8::Local<v8::Object>, StateBase* next);
|
| StateBase* writeArrayBuffer(v8::Local<v8::Value>, StateBase* next);
|
| StateBase* writeTransferredArrayBuffer(v8::Local<v8::Value>, uint32_t index, StateBase* next);
|
| + StateBase* writeTransferredImageBitmap(v8::Local<v8::Value>, uint32_t index, StateBase* next);
|
| StateBase* writeTransferredSharedArrayBuffer(v8::Local<v8::Value>, uint32_t index, StateBase* next);
|
| static bool shouldSerializeDensely(uint32_t length, uint32_t propertyCount);
|
|
|
| @@ -433,6 +437,7 @@ private:
|
| ObjectPool m_objectPool;
|
| ObjectPool m_transferredMessagePorts;
|
| ObjectPool m_transferredArrayBuffers;
|
| + ObjectPool m_transferredImageBitmaps;
|
| uint32_t m_nextObjectReference;
|
| WebBlobInfoArray* m_blobInfo;
|
| BlobDataHandleMap& m_blobDataHandles;
|
| @@ -452,6 +457,7 @@ public:
|
| virtual bool tryGetObjectFromObjectReference(uint32_t reference, v8::Local<v8::Value>*) = 0;
|
| virtual bool tryGetTransferredMessagePort(uint32_t index, v8::Local<v8::Value>*) = 0;
|
| virtual bool tryGetTransferredArrayBuffer(uint32_t index, v8::Local<v8::Value>*) = 0;
|
| + virtual bool tryGetTransferredImageBitmap(uint32_t index, v8::Local<v8::Value>*) = 0;
|
| virtual bool tryGetTransferredSharedArrayBuffer(uint32_t index, v8::Local<v8::Value>*) = 0;
|
| virtual bool newSparseArray(uint32_t length) = 0;
|
| virtual bool newDenseArray(uint32_t length) = 0;
|
| @@ -571,11 +577,13 @@ class CORE_EXPORT ScriptValueDeserializer : public ScriptValueCompositeCreator {
|
| STACK_ALLOCATED();
|
| WTF_MAKE_NONCOPYABLE(ScriptValueDeserializer);
|
| public:
|
| - ScriptValueDeserializer(SerializedScriptValueReader& reader, MessagePortArray* messagePorts, ArrayBufferContentsArray* arrayBufferContents)
|
| + ScriptValueDeserializer(SerializedScriptValueReader& reader, MessagePortArray* messagePorts, ArrayBufferContentsArray* arrayBufferContents, ImageBitmapContentsArray* imageBitmapContents)
|
| : m_reader(reader)
|
| , m_transferredMessagePorts(messagePorts)
|
| , m_arrayBufferContents(arrayBufferContents)
|
| + , m_imageBitmapContents(imageBitmapContents)
|
| , m_arrayBuffers(arrayBufferContents ? arrayBufferContents->size() : 0)
|
| + , m_imageBitmaps(imageBitmapContents ? imageBitmapContents->size() : 0)
|
| , m_version(0)
|
| {
|
| }
|
| @@ -595,6 +603,7 @@ public:
|
| void pushObjectReference(const v8::Local<v8::Value>&) override;
|
| bool tryGetTransferredMessagePort(uint32_t index, v8::Local<v8::Value>*) override;
|
| bool tryGetTransferredArrayBuffer(uint32_t index, v8::Local<v8::Value>*) override;
|
| + bool tryGetTransferredImageBitmap(uint32_t index, v8::Local<v8::Value>*) override;
|
| bool tryGetTransferredSharedArrayBuffer(uint32_t index, v8::Local<v8::Value>*) override;
|
| bool tryGetObjectFromObjectReference(uint32_t reference, v8::Local<v8::Value>*) override;
|
| uint32_t objectReferenceCount() override;
|
| @@ -624,7 +633,9 @@ private:
|
| Vector<uint32_t> m_openCompositeReferenceStack;
|
| MessagePortArray* m_transferredMessagePorts;
|
| ArrayBufferContentsArray* m_arrayBufferContents;
|
| + ImageBitmapContentsArray* m_imageBitmapContents;
|
| Vector<v8::Local<v8::Value>> m_arrayBuffers;
|
| + Vector<v8::Local<v8::Value>> m_imageBitmaps;
|
| uint32_t m_version;
|
| };
|
|
|
|
|