https://bugs.webkit.org/show_bug.cgi?id=73503
authordslomov@google.com <dslomov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 17:57:32 +0000 (17:57 +0000)
committerdslomov@google.com <dslomov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 17:57:32 +0000 (17:57 +0000)
commita0d6a292217aa514bd169af452e5f980564e1083
tree3f6a528c0c02c33c7b23451a77e1ab76634db551
parent038fa8dc8ad14a6d7db1849d0b4f9e466a0d6062
https://bugs.webkit.org/show_bug.cgi?id=73503
[Chromium][V8] Implement ArrayBuffer transfer in chromium.
Portions of this patch come from Luke Zarko.

Source/JavaScriptCore:

Reviewed by David Levin.

* wtf/ArrayBuffer.cpp:
(WTF::ArrayBuffer::transfer): Changed prototype from pointers to RefPtr.
* wtf/ArrayBuffer.h:
(WTF::ArrayBufferContents::transfer): Changed prototype from pointers to RefPtr.
(WTF::ArrayBuffer::isNeutered):
* wtf/TypedArrayBase.h:
(WTF::TypedArrayBase::neuter):

Source/WebCore:

Reviewed by David Levin.

Test: fast/canvas/webgl/arraybuffer-transfer-of-control.html

* bindings/v8/SerializedScriptValue.cpp:
(WebCore::V8ObjectMap::Writer::writeTransferredArrayBuffer):
(WebCore::V8ObjectMap::Serializer::Serializer):
(WebCore::V8ObjectMap::Serializer::writeAndGreyArrayBufferView):
(WebCore::V8ObjectMap::Serializer::writeArrayBuffer):
(WebCore::V8ObjectMap::Serializer::writeTransferredArrayBuffer):
(WebCore::V8ObjectMap::Serializer::doSerialize):
(WebCore::V8ObjectMap::Reader::read):
(WebCore::V8ObjectMap::Reader::readArrayBufferView):
(WebCore::V8ObjectMap::Deserializer::Deserializer):
(WebCore::V8ObjectMap::Deserializer::tryGetTransferredArrayBuffer):
(WebCore::SerializedScriptValue::create):
(WebCore::neuterBinding):
(WebCore::SerializedScriptValue::transferArrayBuffers):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::deserialize):
* bindings/v8/SerializedScriptValue.h:

LayoutTests:

Reviewed by David Levin.

* fast/canvas/webgl/arraybuffer-transfer-of-control-expected.txt: Added.
* fast/canvas/webgl/arraybuffer-transfer-of-control.html: Added.
* fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js: Added.
(isTypedArray):
(isDataView):
(isArrayBuffer):
(assertBufferClosed):
(createBuffer):
(checkBuffer):
(createView):
(createEveryView):
(checkView):
(checkEmptyArray):
(wrapSend):
(wrapFailSend):
(testList.name.send):
(testList.test):
(.name.send):
(.test):
(testList.testList.concat.):
(viewAndBuffer.return.name.bufferType.0.send):
(viewAndBuffer.return.test):
():
(squashUnrelatedViews.return.name.bufferType.0.send):
(squashUnrelatedViews.return.test):
(squashUnrelatedViews):
(testList):
(doneTest):
(windowHandleMessage):
* fast/dom/Window/window-postmessage-args.html:
* platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt:
* platform/gtk/Skipped: Skipped arraybuffer-transfer-of-control.js on JSC platfroms.
* platform/mac/Skipped: Skipped arraybuffer-transfer-of-control.js on JSC platfroms.
* platform/qt/Skipped: Skipped arraybuffer-transfer-of-control.js on JSC platfroms.
* platform/win/Skipped: Skipped arraybuffer-transfer-of-control.js on JSC platfroms.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/webgl/arraybuffer-transfer-of-control-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/arraybuffer-transfer-of-control.html [new file with mode: 0644]
LayoutTests/fast/canvas/webgl/script-tests/arraybuffer-transfer-of-control.js [new file with mode: 0644]
LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
LayoutTests/fast/dom/Window/window-postmessage-args.html
LayoutTests/platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt
LayoutTests/platform/gtk/Skipped
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt/Skipped
LayoutTests/platform/win/Skipped
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wtf/ArrayBuffer.cpp
Source/JavaScriptCore/wtf/ArrayBuffer.h
Source/JavaScriptCore/wtf/TypedArrayBase.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/SerializedScriptValue.cpp
Source/WebCore/bindings/v8/SerializedScriptValue.h