Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 04:08:48 +0000 (04:08 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jun 2016 04:08:48 +0000 (04:08 +0000)
commit86fbd7030ac17eeacac04c3cf741e5aa1bbdfa89
treec0520590b93108a084ef1484d525852752e69089
parent2dac7a2a3086250b440d907229c7164b26eadf70
Retrieving Blobs from IndexedDB using cursors fails in WK2 (Sandboxing)
https://bugs.webkit.org/show_bug.cgi?id=158991

Reviewed by Alex Christensen.

Source/WebCore:

Test: storage/indexeddb/modern/blob-cursor.html

* platform/network/BlobDataFileReference.cpp:
(WebCore::BlobDataFileReference::startTrackingModifications): Deleted.

Source/WebKit2:

* CMakeLists.txt:
* WebKit2.xcodeproj/project.pbxproj:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles):
(WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles):
* DatabaseProcess/DatabaseProcess.h:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult): Handle creation of sandbox extensions
  for any result that might contain blob values.
(WebKit::WebIDBConnectionToClient::didGetRecord):
(WebKit::WebIDBConnectionToClient::didOpenCursor):
(WebKit::WebIDBConnectionToClient::didIterateCursor):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:

* Shared/Databases/IndexedDB/WebIDBResult.cpp: Added.
(WebKit::WebIDBResult::encode):
(WebKit::WebIDBResult::decode):
* Shared/Databases/IndexedDB/WebIDBResult.h: Added.
(WebKit::WebIDBResult::WebIDBResult):
(WebKit::WebIDBResult::resultData):
(WebKit::WebIDBResult::handles):

* Shared/SandboxExtension.h: Make SandboxExtension handles moveable.

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::preregisterSandboxExtensionsIfNecessary): Register sandbox extensions with the
  Networking process for any result that might contain blob values.
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
(WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): Deleted.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/blob-cursor-expected.txt: Added.
* storage/indexeddb/modern/blob-cursor.html: Added.
* storage/indexeddb/modern/resources/blob-cursor.js: Added.
* storage/indexeddb/modern/resources/blob-cursor1.html: Added.
* storage/indexeddb/modern/resources/blob-cursor2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/modern/blob-cursor-expected.txt [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/blob-cursor.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor.js [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor1.html [new file with mode: 0644]
LayoutTests/storage/indexeddb/modern/resources/blob-cursor2.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/network/BlobDataFileReference.cpp
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h
Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.cpp [new file with mode: 0644]
Source/WebKit2/Shared/Databases/IndexedDB/WebIDBResult.h [new file with mode: 0644]
Source/WebKit2/Shared/SandboxExtension.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h
Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in