haikuwebkit/LayoutTests/workers/sab/multi-memory-expected.txt

4 lines
32 B
Plaintext
Raw Permalink Normal View History

SharedArrayBuffer does not need to be in the transfer list https://bugs.webkit.org/show_bug.cgi?id=168079 Reviewed by Geoffrey Garen and Keith Miller. Source/JavaScriptCore: Exposes a simple shareWith() API for when you know you want to share the contents of a shared buffer. Also a useful explicit operator bool. * runtime/ArrayBuffer.cpp: (JSC::ArrayBuffer::shareWith): * runtime/ArrayBuffer.h: (JSC::ArrayBufferContents::operator bool): Source/WebCore: Tests: workers/sab/multi-memory-multi-buffer.html workers/sab/multi-memory.html workers/sab/no-transfer.html workers/sab/postMessage-clones.html workers/sab/sent-from-worker-no-transfer.html workers/sab/sent-from-worker-transfer.html The SAB API that we originally implemented required that SABs get put in transfer lists when they are sent to workers. The new SAB API that everyone is converging towards requires that you do not put the SAB in the transfer list. That's supposed to be an error. Instead, anytime that a SAB is part of any message to or from a dedicated worker then it is automatically shared. The new API provides a lot more clarity about what is supposed to happen in contexts that support transfering but don't support sharing. Right now this patch allows both styles to work, but I hope we can disable the transfer list capability soon. * bindings/js/IDBBindingUtilities.cpp: (WebCore::deserializeIDBValueToJSValue): * bindings/js/JSMessageEventCustom.cpp: (WebCore::JSMessageEvent::data): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: (): Deleted. * dom/CustomEvent.cpp: (WebCore::CustomEvent::trySerializeDetail): * dom/ErrorEvent.cpp: (WebCore::ErrorEvent::trySerializeError): * dom/MessageEvent.cpp: (WebCore::MessageEvent::trySerializeData): * dom/PopStateEvent.cpp: (WebCore::PopStateEvent::trySerializeState): * workers/DedicatedWorkerGlobalScope.cpp: (WebCore::DedicatedWorkerGlobalScope::postMessage): * workers/Worker.cpp: (WebCore::Worker::postMessage): LayoutTests: This adds tests that ensure that SABs behave correctly (are either cloned or shared) depending on context, and that we currently share SABs whether they are in the transfer list or not. This also adds tests for SABs being passed around via more complicated data structures. * workers/sab/multi-memory-expected.txt: Added. * workers/sab/multi-memory-multi-buffer-expected.txt: Added. * workers/sab/multi-memory-multi-buffer.html: Added. * workers/sab/multi-memory-worker-1.js: Added. (onmessage): * workers/sab/multi-memory-worker-2.js: Added. (onmessage): * workers/sab/multi-memory.html: Added. * workers/sab/no-transfer-expected.txt: Added. * workers/sab/no-transfer.html: Added. * workers/sab/postMessage-clones-expected.txt: Added. * workers/sab/postMessage-clones.html: Added. * workers/sab/sab-creator-no-transfer.js: Added. * workers/sab/sab-creator-transfer.js: Added. * workers/sab/sent-from-worker-no-transfer-expected.txt: Added. * workers/sab/sent-from-worker-no-transfer.html: Added. * workers/sab/sent-from-worker-transfer-expected.txt: Added. * workers/sab/sent-from-worker-transfer.html: Added. * workers/sab/worker-resources.js: Canonical link: https://commits.webkit.org/185140@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@212035 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-10 02:42:20 +00:00
All workers done!
Test passed!