Index: third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
index 78f97e6833f511152efab7ee4b8e9783bb006f62..ff6aeb900e2ed45c58f3d5bf967ae1a55be6da8e 100644 |
--- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
+++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp |
@@ -8249,8 +8249,7 @@ static void postMessageImpl(const char* interfaceName, TestObject* instance, con |
// Clear references to array buffers and image bitmaps from transferables |
// so that the serializer can consider the array buffers as |
// non-transferable and serialize them into the message. |
- ArrayBufferArray transferableArrayBuffers = transferables.array_buffers; |
- transferables.array_buffers.Clear(); |
+ ArrayBufferArray transferableArrayBuffers = SerializedScriptValue::ExtractNonSharedArrayBuffers(transferables); |
ImageBitmapArray transferableImageBitmaps = transferables.image_bitmaps; |
transferables.image_bitmaps.Clear(); |
SerializedScriptValue::SerializeOptions options; |
@@ -8259,6 +8258,12 @@ static void postMessageImpl(const char* interfaceName, TestObject* instance, con |
if (exceptionState.HadException()) |
return; |
+ // If the transferable array_buffer list is empty, then it must have been populated with SharedArrayBuffers. They can't be transfered, so throw. |
+ if (!message->GetArrayBufferContentsArray()->IsEmpty()) { |
+ exceptionState.ThrowDOMException(kDataCloneError, "SharedArrayBuffer can not be sent in this context."); |
+ return; |
+ } |
+ |
// Neuter the original array buffers on the sender context. |
SerializedScriptValue::TransferArrayBufferContents(info.GetIsolate(), transferableArrayBuffers, exceptionState); |
if (exceptionState.HadException()) |