Blob content type not preserved when retrieving blobs from IndexedDB.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2016 19:10:35 +0000 (19:10 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Jul 2016 19:10:35 +0000 (19:10 +0000)
commit217b329aa07752a5813b1e7f8167aaf8ac0b4193
tree5f6139a9bc07335f0ce7d196b743bb7353c22e2a
parent44150ef30aaae4438ed65cbfd1f9e1bfbcf96af6
Blob content type not preserved when retrieving blobs from IndexedDB.
<rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/blob-svg-image.html

* fileapi/Blob.cpp:
(WebCore::Blob::Blob):

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::postToMainThread):
(WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Pass along the content type
  to the blob registry so that if the file-backed blob takes over, it has the content type.
(WebCore::threadableQueue): Deleted.
* fileapi/ThreadableBlobRegistry.h:

* platform/network/BlobRegistry.h:

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
* platform/network/BlobRegistryImpl.h:

Source/WebKit2:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
* WebProcess/FileAPI/BlobRegistryProxy.h:

LayoutTests:

* storage/indexeddb/modern/blob-svg-image-expected.txt: Added.
* storage/indexeddb/modern/blob-svg-image.html: Added.
* storage/indexeddb/modern/resources/blob-svg-image.js: Added.
* storage/indexeddb/modern/resources/blob-svg-image1.html: Added.
* storage/indexeddb/modern/resources/blob-svg-image2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/blob-svg-image-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/blob-svg-image.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-svg-image.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-svg-image1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-svg-image2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/fileapi/Blob.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.cpp
Source/WebCore/fileapi/ThreadableBlobRegistry.h
Source/WebCore/platform/network/BlobRegistry.h
Source/WebCore/platform/network/BlobRegistryImpl.cpp
Source/WebCore/platform/network/BlobRegistryImpl.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp
Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h