Modern IDB: Properly handle blobs in Workers.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2016 23:15:15 +0000 (23:15 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 May 2016 23:15:15 +0000 (23:15 +0000)
commitf975e22d5415c63c15635bc46e642a3909c7521e
tree167894c8415e6644294cb004ea15add10a3c9cf9
parent2549c6c64ef6e363d1cc358ffbc9bd700098322e
Modern IDB: Properly handle blobs in Workers.
https://bugs.webkit.org/show_bug.cgi?id=157947

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/blob-simple-workers.html

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer): Use writeBlobsToDiskForIndexedDBSynchronously from
  background threads instead of the asynchronous form.

Add ability to set an existing empty IDBValue to be an isolated copy of a different IDBValue:
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::setAsIsolatedCopy):
(WebCore::IDBValue::isolatedCopy):
* Modules/indexeddb/IDBValue.h:

Add a method - only to be called from a non-main thread - that synchronously writes blobs to disk:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
* bindings/js/SerializedScriptValue.h:

LayoutTests:

* storage/indexeddb/modern/blob-simple-workers-expected.txt: Added.
* storage/indexeddb/modern/blob-simple-workers.html: Added.
* storage/indexeddb/modern/resources/blob-simple-workers.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201232 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/blob-simple-workers-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/blob-simple-workers.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-simple-workers.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/Modules/indexeddb/IDBValue.cpp
Source/WebCore/Modules/indexeddb/IDBValue.h
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/bindings/js/SerializedScriptValue.h