Storing blobs in IDB on iOS: "Error preparing blob/file"
authorsihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 16:58:37 +0000 (16:58 +0000)
committersihui_liu@apple.com <sihui_liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Nov 2018 16:58:37 +0000 (16:58 +0000)
commit752c7b81841032dd91dd9cef92d34b1d6420f1ae
treea15abb16686e96931de9e0c0fbd0e8a31eefb9a7
parent93b7317cbc8666ba332358bcdaf35e3bf040101c
Storing blobs in IDB on iOS: "Error preparing blob/file"
https://bugs.webkit.org/show_bug.cgi?id=188438
<rdar://problem/43097279>

Reviewed by Alex Christensen.

Source/WebCore:

Grant sandbox extension of temp folder to network process, because we suggested network process had access to
the folder on iOS device but it didn't.

This makes some existing tests about IDB blob pass on iOS device.

* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit:

Grant sandbox extension of temp folder to network process, and clean up some code that managed sandbox extension
of IDB temporary blob files in network process.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::handleGetResult):
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Deleted.
(WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::accessToTemporaryFileComplete):
(WebKit::NetworkProcess::getSandboxExtensionsForBlobFiles):
(WebKit::NetworkProcess::prepareForAccessToTemporaryFile): Deleted.
(WebKit::NetworkProcess::updateTemporaryFileSandboxExtensions): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode const):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureNetworkProcess):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didGetRecord):
(WebKit::WebIDBConnectionToServer::didGetAllRecords):
(WebKit::WebIDBConnectionToServer::didOpenCursor):
(WebKit::WebIDBConnectionToServer::didIterateCursor):
(WebKit::preregisterSandboxExtensionsIfNecessary): Deleted.

LayoutTests:

Three IDB blob tests are passing on iOS device now.

* platform/ios-device/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/ios-device/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h
Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp
Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Source/WebKit/NetworkProcess/NetworkProcess.h
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Source/WebKit/UIProcess/WebProcessPool.cpp
Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp