Diff
Modified: trunk/LayoutTests/ChangeLog (238282 => 238283)
--- trunk/LayoutTests/ChangeLog 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/LayoutTests/ChangeLog 2018-11-16 16:58:37 UTC (rev 238283)
@@ -1,3 +1,15 @@
+2018-11-16 Sihui Liu <[email protected]>
+
+ 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.
+
+ Three IDB blob tests are passing on iOS device now.
+
+ * platform/ios-device/TestExpectations:
+
2018-11-16 Zalan Bujtas <[email protected]>
[iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com
Modified: trunk/LayoutTests/platform/ios-device/TestExpectations (238282 => 238283)
--- trunk/LayoutTests/platform/ios-device/TestExpectations 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/LayoutTests/platform/ios-device/TestExpectations 2018-11-16 16:58:37 UTC (rev 238283)
@@ -60,9 +60,6 @@
http/tests/preload/onload_event.html [ Skip ]
http/tests/websocket/tests/hybi/multiple-connections.html [ Skip ]
-imported/blink/storage/indexeddb/blob-delete-objectstore-db.html [ Failure ]
-imported/blink/storage/indexeddb/blob-valid-after-deletion.html [ Failure ]
-imported/blink/storage/indexeddb/blob-valid-before-commit.html [ Failure ]
imported/w3c/web-platform-tests/IndexedDB/keypath-special-identifiers.htm [ Failure ]
imported/w3c/web-platform-tests/cssom-view/Screen-pixelDepth-Screen-colorDepth001.html [ Failure ]
imported/w3c/web-platform-tests/cssom-view/scrolling-quirks-vs-nonquirks.html [ Failure ]
Modified: trunk/Source/WebCore/ChangeLog (238282 => 238283)
--- trunk/Source/WebCore/ChangeLog 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebCore/ChangeLog 2018-11-16 16:58:37 UTC (rev 238283)
@@ -1,3 +1,23 @@
+2018-11-16 Sihui Liu <[email protected]>
+
+ 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.
+
+ 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:
+
2018-11-16 Don Olmstead <[email protected]>
Add USE(LIBWPE) to WebCore
Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (238282 => 238283)
--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h 2018-11-16 16:58:37 UTC (rev 238283)
@@ -59,7 +59,6 @@
class IDBBackingStoreTemporaryFileHandler {
public:
virtual ~IDBBackingStoreTemporaryFileHandler() = default;
- virtual void prepareForAccessToTemporaryFile(const String& path) = 0;
virtual void accessToTemporaryFileComplete(const String& path) = 0;
};
Modified: trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp (238282 => 238283)
--- trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBTransaction.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -89,8 +89,6 @@
{
String databaseDirectory = m_backingStore.fullDatabaseDirectory();
for (auto& entry : m_blobTemporaryAndStoredFilenames) {
- m_backingStore.temporaryFileHandler().prepareForAccessToTemporaryFile(entry.first);
-
if (!FileSystem::hardLinkOrCopyFile(entry.first, FileSystem::pathByAppendingComponent(databaseDirectory, entry.second)))
LOG_ERROR("Failed to link/copy temporary blob file '%s' to location '%s'", entry.first.utf8().data(), FileSystem::pathByAppendingComponent(databaseDirectory, entry.second).utf8().data());
@@ -108,7 +106,6 @@
String databaseDirectory = m_backingStore.fullDatabaseDirectory();
for (auto& entry : m_blobRemovedFilenames) {
String fullPath = FileSystem::pathByAppendingComponent(databaseDirectory, entry);
- m_backingStore.temporaryFileHandler().prepareForAccessToTemporaryFile(fullPath);
m_backingStore.temporaryFileHandler().accessToTemporaryFileComplete(fullPath);
}
@@ -117,10 +114,8 @@
IDBError SQLiteIDBTransaction::abort()
{
- for (auto& entry : m_blobTemporaryAndStoredFilenames) {
- m_backingStore.temporaryFileHandler().prepareForAccessToTemporaryFile(entry.first);
+ for (auto& entry : m_blobTemporaryAndStoredFilenames)
m_backingStore.temporaryFileHandler().accessToTemporaryFileComplete(entry.first);
- }
m_blobTemporaryAndStoredFilenames.clear();
Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (238282 => 238283)
--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h 2018-11-16 16:58:37 UTC (rev 238283)
@@ -112,7 +112,6 @@
void ref() override { RefCounted<InProcessIDBServer>::ref(); }
void deref() override { RefCounted<InProcessIDBServer>::deref(); }
- void prepareForAccessToTemporaryFile(const String&) override { }
void accessToTemporaryFileComplete(const String& path) override;
private:
Modified: trunk/Source/WebKit/ChangeLog (238282 => 238283)
--- trunk/Source/WebKit/ChangeLog 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/ChangeLog 2018-11-16 16:58:37 UTC (rev 238283)
@@ -1,3 +1,45 @@
+2018-11-16 Sihui Liu <[email protected]>
+
+ 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.
+
+ 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.
+
2018-11-16 Don Olmstead <[email protected]>
Add USE(LIBWPE) to WebCore
Modified: trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -88,11 +88,8 @@
void NetworkBlobRegistry::registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess* connection, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
{
- auto fileReference = connection->getBlobDataFileReferenceForPath(fileBackedPath);
- ASSERT(fileReference);
+ blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath, nullptr), contentType);
- blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(fileReference), contentType);
-
ASSERT(!m_blobsForConnection.get(connection).contains(url));
BlobForConnectionMap::iterator mapIterator = m_blobsForConnection.find(connection);
if (mapIterator == m_blobsForConnection.end())
Modified: trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -157,13 +157,7 @@
return;
}
-#if ENABLE(SANDBOX_EXTENSIONS)
- NetworkProcess::singleton().getSandboxExtensionsForBlobFiles(blobFilePaths, [protectedThis = makeRef(*this), this, resultData](SandboxExtension::HandleArray&& handles) {
- send(MessageType({ resultData, WTFMove(handles) }));
- });
-#else
send(MessageType(resultData));
-#endif
}
void WebIDBConnectionToClient::didGetRecord(const WebCore::IDBResultData& resultData)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -507,25 +507,6 @@
NetworkBlobRegistry::singleton().registerBlobURL(this, url, srcURL, shouldBypassConnectionCheck);
}
-void NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob(const Vector<String>& filePaths, SandboxExtension::HandleArray&& handles)
-{
-#if ENABLE(SANDBOX_EXTENSIONS)
- ASSERT(filePaths.size() == handles.size());
-
- for (size_t i = 0; i < filePaths.size(); ++i)
- m_blobDataFileReferences.add(filePaths[i], BlobDataFileReferenceWithSandboxExtension::create(filePaths[i], SandboxExtension::create(WTFMove(handles[i]))));
-#else
- for (size_t i = 0; i < filePaths.size(); ++i)
- m_blobDataFileReferences.add(filePaths[i], BlobDataFileReferenceWithSandboxExtension::create(filePaths[i], nullptr));
-#endif
-}
-
-RefPtr<WebCore::BlobDataFileReference> NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath(const String& path)
-{
- ASSERT(m_blobDataFileReferences.contains(path));
- return m_blobDataFileReferences.get(path);
-}
-
void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
{
NetworkBlobRegistry::singleton().registerBlobURLOptionallyFileBacked(this, url, srcURL, fileBackedPath, contentType);
@@ -559,13 +540,6 @@
for (auto& file : fileReferences)
file->revokeFileAccess();
-#if ENABLE(SANDBOX_EXTENSIONS)
- NetworkProcess::singleton().getSandboxExtensionsForBlobFiles(fileNames, [protectedThis = WTFMove(protectedThis), fileNames](SandboxExtension::HandleArray&& handles) {
- ASSERT(fileNames.size() == handles.size());
- NetworkProcess::singleton().updateTemporaryFileSandboxExtensions(fileNames, handles);
- });
-#endif
-
m_connection->send(Messages::NetworkProcessConnection::DidWriteBlobsToTemporaryFiles(requestIdentifier, fileNames), 0);
});
}
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h 2018-11-16 16:58:37 UTC (rev 238283)
@@ -164,7 +164,6 @@
void registerFileBlobURL(const WebCore::URL&, const String& path, SandboxExtension::Handle&&, const String& contentType);
void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
void registerBlobURLFromURL(const WebCore::URL&, const WebCore::URL& srcURL, bool shouldBypassConnectionCheck);
- void preregisterSandboxExtensionsForOptionallyFileBackedBlob(const Vector<String>& fileBackedPath, SandboxExtension::HandleArray&&);
void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, const String& fileBackedPath, const String& contentType);
void registerBlobURLForSlice(const WebCore::URL&, const WebCore::URL& srcURL, int64_t start, int64_t end);
void blobSize(const WebCore::URL&, uint64_t& resultSize);
Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in 2018-11-16 16:58:37 UTC (rev 238283)
@@ -44,7 +44,6 @@
RegisterFileBlobURL(WebCore::URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType)
RegisterBlobURL(WebCore::URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
RegisterBlobURLFromURL(WebCore::URL url, WebCore::URL srcURL, bool shouldBypassConnectionCheck)
- PreregisterSandboxExtensionsForOptionallyFileBackedBlob(Vector<String> filePaths, WebKit::SandboxExtension::HandleArray extensionHandles)
RegisterBlobURLOptionallyFileBacked(WebCore::URL url, WebCore::URL srcURL, String fileBackedPath, String contentType)
RegisterBlobURLForSlice(WebCore::URL url, WebCore::URL srcURL, int64_t start, int64_t end)
UnregisterBlobURL(WebCore::URL url)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -1147,12 +1147,6 @@
task.performTask();
}
-void NetworkProcess::prepareForAccessToTemporaryFile(const String& path)
-{
- if (auto extension = m_blobTemporaryFileSandboxExtensions.get(path))
- extension->consume();
-}
-
void NetworkProcess::accessToTemporaryFileComplete(const String& path)
{
// We've either hard linked the temporary blob file to the database directory, copied it there,
@@ -1159,9 +1153,6 @@
// or the transaction is being aborted.
// In any of those cases, we can delete the temporary blob file now.
FileSystem::deleteFile(path);
-
- if (auto extension = m_blobTemporaryFileSandboxExtensions.take(path))
- extension->revoke();
}
HashSet<WebCore::SecurityOriginData> NetworkProcess::indexedDatabaseOrigins(const String& path)
@@ -1212,14 +1203,6 @@
{
parentProcessConnection()->sendWithAsyncReply(Messages::NetworkProcessProxy::GetSandboxExtensionsForBlobFiles(filenames), WTFMove(completionHandler));
}
-
-void NetworkProcess::updateTemporaryFileSandboxExtensions(const Vector<String>& paths, SandboxExtension::HandleArray& handles)
-{
- for (size_t i = 0; i < handles.size(); ++i) {
- auto result = m_blobTemporaryFileSandboxExtensions.add(paths[i], SandboxExtension::create(WTFMove(handles[i])));
- ASSERT_UNUSED(result, result.isNewEntry);
- }
-}
#endif // ENABLE(SANDBOX_EXTENSIONS)
#if ENABLE(SERVICE_WORKER)
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2018-11-16 16:58:37 UTC (rev 238283)
@@ -190,7 +190,6 @@
#if ENABLE(INDEXED_DATABASE)
WebCore::IDBServer::IDBServer& idbServer(PAL::SessionID);
// WebCore::IDBServer::IDBBackingStoreFileHandler.
- void prepareForAccessToTemporaryFile(const String& path) final;
void accessToTemporaryFileComplete(const String& path) final;
void setIDBPerOriginQuota(uint64_t);
#endif
@@ -197,7 +196,6 @@
#if ENABLE(SANDBOX_EXTENSIONS)
void getSandboxExtensionsForBlobFiles(const Vector<String>& filenames, CompletionHandler<void(SandboxExtension::HandleArray&&)>&&);
- void updateTemporaryFileSandboxExtensions(const Vector<String>& paths, SandboxExtension::HandleArray&);
#endif
void didReceiveNetworkProcessMessage(IPC::Connection&, IPC::Decoder&);
@@ -401,8 +399,6 @@
uint64_t m_idbPerOriginQuota;
#endif
- HashMap<String, RefPtr<SandboxExtension>> m_blobTemporaryFileSandboxExtensions;
-
Deque<CrossThreadTask> m_storageTasks;
Lock m_storageTaskMutex;
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -59,7 +59,10 @@
encoder << cookieStorageDirectoryExtensionHandle;
encoder << containerCachesDirectoryExtensionHandle;
encoder << parentBundleDirectoryExtensionHandle;
+#if ENABLE(INDEXED_DATABASE)
+ encoder << indexedDatabaseTempBlobDirectoryExtensionHandle;
#endif
+#endif
encoder << shouldSuppressMemoryPressureHandler;
encoder << shouldUseTestingNetworkSession;
encoder << loadThrottleLatency;
@@ -168,7 +171,15 @@
if (!parentBundleDirectoryExtensionHandle)
return false;
result.parentBundleDirectoryExtensionHandle = WTFMove(*parentBundleDirectoryExtensionHandle);
+
+#if ENABLE(INDEXED_DATABASE)
+ std::optional<SandboxExtension::Handle> indexedDatabaseTempBlobDirectoryExtensionHandle;
+ decoder >> indexedDatabaseTempBlobDirectoryExtensionHandle;
+ if (!indexedDatabaseTempBlobDirectoryExtensionHandle)
+ return false;
+ result.indexedDatabaseTempBlobDirectoryExtensionHandle = WTFMove(*indexedDatabaseTempBlobDirectoryExtensionHandle);
#endif
+#endif
if (!decoder.decode(result.shouldSuppressMemoryPressureHandler))
return false;
if (!decoder.decode(result.shouldUseTestingNetworkSession))
Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h 2018-11-16 16:58:37 UTC (rev 238283)
@@ -70,7 +70,10 @@
SandboxExtension::Handle cookieStorageDirectoryExtensionHandle;
SandboxExtension::Handle containerCachesDirectoryExtensionHandle;
SandboxExtension::Handle parentBundleDirectoryExtensionHandle;
+#if ENABLE(INDEXED_DATABASE)
+ SandboxExtension::Handle indexedDatabaseTempBlobDirectoryExtensionHandle;
#endif
+#endif
bool shouldSuppressMemoryPressureHandler { false };
bool shouldUseTestingNetworkSession { false };
Seconds loadThrottleLatency;
Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm (238282 => 238283)
--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm 2018-11-16 16:58:37 UTC (rev 238283)
@@ -78,7 +78,10 @@
SandboxExtension::consumePermanently(parameters.cookieStorageDirectoryExtensionHandle);
SandboxExtension::consumePermanently(parameters.containerCachesDirectoryExtensionHandle);
SandboxExtension::consumePermanently(parameters.parentBundleDirectoryExtensionHandle);
+#if ENABLE(INDEXED_DATABASE)
+ SandboxExtension::consumePermanently(parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
#endif
+#endif
m_diskCacheDirectory = parameters.diskCacheDirectory;
_CFNetworkSetATSContext(parameters.networkATSContext.get());
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (238282 => 238283)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -511,7 +511,11 @@
String parentBundleDirectory = this->parentBundleDirectory();
if (!parentBundleDirectory.isEmpty())
SandboxExtension::createHandle(parentBundleDirectory, SandboxExtension::Type::ReadOnly, parameters.parentBundleDirectoryExtensionHandle);
+
+#if ENABLE(INDEXED_DATABASE)
+ SandboxExtension::createHandleForTemporaryFile(emptyString(), SandboxExtension::Type::ReadWrite, parameters.indexedDatabaseTempBlobDirectoryExtensionHandle);
#endif
+#endif
parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
parameters.presentingApplicationPID = m_configuration->presentingApplicationPID();
Modified: trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (238282 => 238283)
--- trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp 2018-11-16 16:38:53 UTC (rev 238282)
+++ trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp 2018-11-16 16:58:37 UTC (rev 238283)
@@ -279,34 +279,13 @@
m_connectionToServer->didPutOrAdd(result);
}
-static void preregisterSandboxExtensionsIfNecessary(const WebIDBResult& result)
-{
- auto resultType = result.resultData().type();
- if (resultType != IDBResultType::GetRecordSuccess && resultType != IDBResultType::OpenCursorSuccess && resultType != IDBResultType::IterateCursorSuccess && resultType != IDBResultType::GetAllRecordsSuccess) {
- ASSERT(resultType == IDBResultType::Error);
- return;
- }
-
- const auto filePaths = resultType == IDBResultType::GetAllRecordsSuccess ? result.resultData().getAllResult().allBlobFilePaths() : result.resultData().getResult().value().blobFilePaths();
-
-#if ENABLE(SANDBOX_EXTENSIONS)
- ASSERT(filePaths.size() == result.handles().size());
-#endif
-
- if (!filePaths.isEmpty())
- WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
-}
-
void WebIDBConnectionToServer::didGetRecord(const WebIDBResult& result)
{
- preregisterSandboxExtensionsIfNecessary(result);
m_connectionToServer->didGetRecord(result.resultData());
}
void WebIDBConnectionToServer::didGetAllRecords(const WebIDBResult& result)
{
- if (result.resultData().getAllResult().type() == IndexedDB::GetAllType::Values)
- preregisterSandboxExtensionsIfNecessary(result);
m_connectionToServer->didGetAllRecords(result.resultData());
}
@@ -322,13 +301,11 @@
void WebIDBConnectionToServer::didOpenCursor(const WebIDBResult& result)
{
- preregisterSandboxExtensionsIfNecessary(result);
m_connectionToServer->didOpenCursor(result.resultData());
}
void WebIDBConnectionToServer::didIterateCursor(const WebIDBResult& result)
{
- preregisterSandboxExtensionsIfNecessary(result);
m_connectionToServer->didIterateCursor(result.resultData());
}