haikuwebkit/Source/WTF/wtf/CrossThreadTask.h

110 lines
4.5 KiB
C
Raw Permalink Normal View History

DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
/*
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
* Copyright (C) 2013, 2015, 2016 Apple Inc. All rights reserved.
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
#pragma once
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
#include <wtf/CrossThreadCopier.h>
Rename NoncopyableFunction to Function https://bugs.webkit.org/show_bug.cgi?id=158354 Reviewed by Chris Dumez. Source/WebCore: * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::runTask): * Modules/mediastream/MediaEndpointPeerConnection.h: * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::resume): (WebCore::AudioDestinationNode::suspend): (WebCore::AudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.h: * dom/ActiveDOMCallbackMicrotask.cpp: (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask): * dom/ActiveDOMCallbackMicrotask.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::Task::Task): * fileapi/AsyncFileStream.cpp: (WebCore::callOnFileThread): (WebCore::AsyncFileStream::perform): * fileapi/AsyncFileStream.h: * page/FrameView.cpp: (WebCore::FrameView::queuePostLayoutCallback): (WebCore::FrameView::flushPostLayoutTasksQueue): * page/FrameView.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::dispatch): (WebCore::ScrollingThread::dispatchBarrier): (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread): * page/scrolling/ScrollingThread.h: * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): * platform/GenericTaskQueue.h: (WebCore::TaskDispatcher::postTask): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::scheduleDeferredTask): * style/StyleTreeResolver.cpp: (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::queuePostResolutionCallback): * style/StyleTreeResolver.h: Source/WebKit: * Storage/StorageSyncManager.cpp: (WebCore::StorageSyncManager::dispatch): * Storage/StorageSyncManager.h: * Storage/StorageThread.cpp: (WebCore::StorageThread::dispatch): (WebCore::StorageThread::terminate): * Storage/StorageThread.h: Source/WebKit2: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * NetworkProcess/cache/NetworkCacheStorage.h: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CrossThreadTask.h: (WTF::CrossThreadTask::CrossThreadTask): * wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h. * wtf/FunctionDispatcher.h: * wtf/MainThread.cpp: (WTF::functionQueue): (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/MainThread.h: * wtf/RunLoop.cpp: (WTF::RunLoop::performWork): (WTF::RunLoop::dispatch): * wtf/RunLoop.h: * wtf/WorkQueue.h: * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/efl/DispatchQueueWorkItemEfl.h: (WorkItem::WorkItem): (TimerWorkItem::create): (TimerWorkItem::TimerWorkItem): * wtf/efl/WorkQueueEfl.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/generic/RunLoopGeneric.cpp: (WTF::RunLoop::TimerBase::ScheduledTask::create): (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask): (WTF::RunLoop::dispatchAfter): * wtf/generic/WorkQueueGeneric.cpp: (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * wtf/glib/RunLoopGLib.cpp: (WTF::DispatchAfterContext::DispatchAfterContext): (WTF::RunLoop::dispatchAfter): * wtf/win/WorkItemWin.cpp: (WTF::WorkItemWin::WorkItemWin): (WTF::WorkItemWin::create): (WTF::HandleWorkItem::HandleWorkItem): (WTF::HandleWorkItem::createByAdoptingHandle): * wtf/win/WorkItemWin.h: (WTF::WorkItemWin::function): * wtf/win/WorkQueueWin.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): Canonical link: https://commits.webkit.org/177198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-24 19:40:19 +00:00
#include <wtf/Function.h>
#include <wtf/RefPtr.h>
Make createCrossThreadTask() functions return on the stack instead of the heap. https://bugs.webkit.org/show_bug.cgi?id=158215 Reviewed by Darin Adler. Source/WebCore: No new tests (Refactor, no change in behavior). * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::postDatabaseTask): (WebCore::IDBServer::IDBServer::postDatabaseTaskReply): (WebCore::IDBServer::IDBServer::databaseRunLoop): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask): (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::postCrossThreadTask): * fileapi/ThreadableBlobRegistry.cpp: (WebCore::threadableQueue): Source/WebKit2: * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): (WebKit::DatabaseProcess::fetchWebsiteData): * DatabaseProcess/DatabaseProcess.h: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CrossThreadCopier.cpp: * wtf/CrossThreadQueue.h: Added. A lightweight of MessageQueue that deals directly in objects instead of in std::unique_ptrs. (WTF::CrossThreadQueue::isKilled): (WTF::CrossThreadQueue<DataType>::append): (WTF::CrossThreadQueue<DataType>::waitForMessage): (WTF::CrossThreadQueue<DataType>::tryGetMessage): * wtf/CrossThreadTask.h: (WTF::createCrossThreadTask): (WTF::CrossThreadTask::CrossThreadTask): Deleted. Canonical link: https://commits.webkit.org/176314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 19:33:22 +00:00
#include <wtf/StdLibExtras.h>
#include <wtf/ThreadSafeRefCounted.h>
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
namespace WTF {
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
Move WebKit2 AsyncTask to WebCore CrossThreadTask. https://bugs.webkit.org/show_bug.cgi?id=149651 Reviewed by Alex Christensen. Source/WebCore: No new tests (No change in behavior). It will be needed in WebCore to support IndexedDB. * WebCore.xcodeproj/project.pbxproj: * platform/CrossThreadTask.h: Renamed from Source/WebKit2/Shared/AsyncTask.h. (WebKit::CrossThreadTask::CrossThreadTask): (WebKit::CrossThreadTask::performTask): (WebKit::createCrossThreadTask): Source/WebKit2: * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): (WebKit::DatabaseProcess::fetchWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteData): (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins): * DatabaseProcess/DatabaseProcess.h: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::shutdown): (WebKit::UniqueIDBDatabase::shutdownBackingStore): (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): (WebKit::UniqueIDBDatabase::openTransaction): (WebKit::UniqueIDBDatabase::beginTransaction): (WebKit::UniqueIDBDatabase::commitTransaction): (WebKit::UniqueIDBDatabase::resetTransaction): (WebKit::UniqueIDBDatabase::rollbackTransaction): (WebKit::UniqueIDBDatabase::postTransactionOperation): (WebKit::UniqueIDBDatabase::changeDatabaseVersion): (WebKit::UniqueIDBDatabase::createObjectStore): (WebKit::UniqueIDBDatabase::deleteObjectStore): (WebKit::UniqueIDBDatabase::clearObjectStore): (WebKit::UniqueIDBDatabase::createIndex): (WebKit::UniqueIDBDatabase::deleteIndex): (WebKit::UniqueIDBDatabase::putRecord): (WebKit::UniqueIDBDatabase::getRecord): (WebKit::UniqueIDBDatabase::openCursor): (WebKit::UniqueIDBDatabase::cursorAdvance): (WebKit::UniqueIDBDatabase::cursorIterate): (WebKit::UniqueIDBDatabase::count): (WebKit::UniqueIDBDatabase::deleteRange): (WebKit::UniqueIDBDatabase::openBackingStoreTransaction): (WebKit::UniqueIDBDatabase::beginBackingStoreTransaction): (WebKit::UniqueIDBDatabase::commitBackingStoreTransaction): (WebKit::UniqueIDBDatabase::resetBackingStoreTransaction): (WebKit::UniqueIDBDatabase::rollbackBackingStoreTransaction): (WebKit::UniqueIDBDatabase::changeDatabaseVersionInBackingStore): (WebKit::UniqueIDBDatabase::createObjectStoreInBackingStore): (WebKit::UniqueIDBDatabase::deleteObjectStoreInBackingStore): (WebKit::UniqueIDBDatabase::clearObjectStoreInBackingStore): (WebKit::UniqueIDBDatabase::createIndexInBackingStore): (WebKit::UniqueIDBDatabase::deleteIndexInBackingStore): (WebKit::UniqueIDBDatabase::putRecordInBackingStore): (WebKit::UniqueIDBDatabase::getRecordFromBackingStore): (WebKit::UniqueIDBDatabase::openCursorInBackingStore): (WebKit::UniqueIDBDatabase::advanceCursorInBackingStore): (WebKit::UniqueIDBDatabase::iterateCursorInBackingStore): (WebKit::UniqueIDBDatabase::countInBackingStore): (WebKit::UniqueIDBDatabase::deleteRangeInBackingStore): (WebKit::UniqueIDBDatabase::postMainThreadTask): (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: * WebKit2.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/167748@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190331 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-09-29 23:28:22 +00:00
class CrossThreadTask {
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced https://bugs.webkit.org/show_bug.cgi?id=200611 Reviewed by Saam Barati. Source/JavaScriptCore: This patch aggressively puts many classes into FastMalloc. In JSC side, we grep `std::make_unique` etc. to find potentially system-malloc-allocated classes. After this patch, all the JSC related allocations in JetStream2 cli is done from bmalloc. In the future, it would be nice that we add `WTF::makeUnique<T>` helper function and throw a compile error if `T` is not FastMalloc annotated[1]. Putting WebKit classes in FastMalloc has many benefits. 1. Simply, it is fast. 2. vmmap can tell the amount of memory used for WebKit. 3. bmalloc can isolate WebKit memory allocation from the rest of the world. This is useful since we can know more about what component is corrupting the memory from the memory corruption crash. [1]: https://bugs.webkit.org/show_bug.cgi?id=200620 * API/ObjCCallbackFunction.mm: * assembler/AbstractMacroAssembler.h: * b3/B3PhiChildren.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirDisassembler.h: * bytecode/AccessCaseSnippetParams.h: * bytecode/CallVariant.h: * bytecode/DeferredSourceDump.h: * bytecode/ExecutionCounter.h: * bytecode/GetByIdStatus.h: * bytecode/GetByIdVariant.h: * bytecode/InByIdStatus.h: * bytecode/InByIdVariant.h: * bytecode/InstanceOfStatus.h: * bytecode/InstanceOfVariant.h: * bytecode/PutByIdStatus.h: * bytecode/PutByIdVariant.h: * bytecode/ValueProfile.h: * dfg/DFGAbstractInterpreter.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::newVariableAccessData): * dfg/DFGFlowIndexing.h: * dfg/DFGFlowMap.h: * dfg/DFGLiveCatchVariablePreservationPhase.cpp: (JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData): * dfg/DFGMaximalFlushInsertionPhase.cpp: (JSC::DFG::MaximalFlushInsertionPhase::newVariableAccessData): * dfg/DFGOSRExit.h: * dfg/DFGSpeculativeJIT.h: * dfg/DFGVariableAccessData.h: * disassembler/ARM64/A64DOpcode.h: * inspector/remote/socket/RemoteInspectorMessageParser.h: * inspector/remote/socket/RemoteInspectorSocket.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/PCToCodeOriginMap.h: * runtime/BasicBlockLocation.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/JSRunLoopTimer.h: * runtime/PromiseDeferredTimer.h: (JSC::PromiseDeferredTimer::create): PromiseDeferredTimer should be allocated as `Ref<>` instead of `std::unique_ptr` since it is inheriting ThreadSafeRefCounted<>. Holding such a class with std::unique_ptr could lead to potentially dangerous operations (like, someone holds it with Ref<> while it is deleted by std::unique_ptr<>). * runtime/RandomizingFuzzerAgent.h: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * tools/JSDollarVM.cpp: * tools/SigillCrashAnalyzer.cpp: * wasm/WasmFormat.h: * wasm/WasmMemory.cpp: * wasm/WasmSignature.h: * yarr/YarrJIT.h: Source/WebCore: Changed the accessor since we changed std::unique_ptr to Ref for this field. No behavior change. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): Source/WTF: WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`. Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited. * wtf/Assertions.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/Bag.h: (WTF::Bag::Bag): Deleted. (WTF::Bag::~Bag): Deleted. (WTF::Bag::clear): Deleted. (WTF::Bag::add): Deleted. (WTF::Bag::iterator::iterator): Deleted. (WTF::Bag::iterator::operator! const): Deleted. (WTF::Bag::iterator::operator* const): Deleted. (WTF::Bag::iterator::operator++): Deleted. (WTF::Bag::iterator::operator== const): Deleted. (WTF::Bag::iterator::operator!= const): Deleted. (WTF::Bag::begin): Deleted. (WTF::Bag::begin const): Deleted. (WTF::Bag::end const): Deleted. (WTF::Bag::isEmpty const): Deleted. (WTF::Bag::unwrappedHead const): Deleted. * wtf/BitVector.h: (WTF::BitVector::BitVector): Deleted. (WTF::BitVector::~BitVector): Deleted. (WTF::BitVector::operator=): Deleted. (WTF::BitVector::size const): Deleted. (WTF::BitVector::ensureSize): Deleted. (WTF::BitVector::quickGet const): Deleted. (WTF::BitVector::quickSet): Deleted. (WTF::BitVector::quickClear): Deleted. (WTF::BitVector::get const): Deleted. (WTF::BitVector::contains const): Deleted. (WTF::BitVector::set): Deleted. (WTF::BitVector::add): Deleted. (WTF::BitVector::ensureSizeAndSet): Deleted. (WTF::BitVector::clear): Deleted. (WTF::BitVector::remove): Deleted. (WTF::BitVector::merge): Deleted. (WTF::BitVector::filter): Deleted. (WTF::BitVector::exclude): Deleted. (WTF::BitVector::bitCount const): Deleted. (WTF::BitVector::isEmpty const): Deleted. (WTF::BitVector::findBit const): Deleted. (WTF::BitVector::isEmptyValue const): Deleted. (WTF::BitVector::isDeletedValue const): Deleted. (WTF::BitVector::isEmptyOrDeletedValue const): Deleted. (WTF::BitVector::operator== const): Deleted. (WTF::BitVector::hash const): Deleted. (WTF::BitVector::iterator::iterator): Deleted. (WTF::BitVector::iterator::operator* const): Deleted. (WTF::BitVector::iterator::operator++): Deleted. (WTF::BitVector::iterator::isAtEnd const): Deleted. (WTF::BitVector::iterator::operator== const): Deleted. (WTF::BitVector::iterator::operator!= const): Deleted. (WTF::BitVector::begin const): Deleted. (WTF::BitVector::end const): Deleted. (WTF::BitVector::bitsInPointer): Deleted. (WTF::BitVector::maxInlineBits): Deleted. (WTF::BitVector::byteCount): Deleted. (WTF::BitVector::makeInlineBits): Deleted. (WTF::BitVector::cleanseInlineBits): Deleted. (WTF::BitVector::bitCount): Deleted. (WTF::BitVector::findBitFast const): Deleted. (WTF::BitVector::findBitSimple const): Deleted. (WTF::BitVector::OutOfLineBits::numBits const): Deleted. (WTF::BitVector::OutOfLineBits::numWords const): Deleted. (WTF::BitVector::OutOfLineBits::bits): Deleted. (WTF::BitVector::OutOfLineBits::bits const): Deleted. (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted. (WTF::BitVector::isInline const): Deleted. (WTF::BitVector::outOfLineBits const): Deleted. (WTF::BitVector::outOfLineBits): Deleted. (WTF::BitVector::bits): Deleted. (WTF::BitVector::bits const): Deleted. * wtf/Bitmap.h: (WTF::Bitmap::size): Deleted. (WTF::Bitmap::iterator::iterator): Deleted. (WTF::Bitmap::iterator::operator* const): Deleted. (WTF::Bitmap::iterator::operator++): Deleted. (WTF::Bitmap::iterator::operator== const): Deleted. (WTF::Bitmap::iterator::operator!= const): Deleted. (WTF::Bitmap::begin const): Deleted. (WTF::Bitmap::end const): Deleted. * wtf/Box.h: * wtf/BumpPointerAllocator.h: * wtf/CPUTime.h: * wtf/CheckedBoolean.h: * wtf/CommaPrinter.h: (WTF::CommaPrinter::CommaPrinter): Deleted. (WTF::CommaPrinter::dump const): Deleted. (WTF::CommaPrinter::didPrint const): Deleted. * wtf/CompactPointerTuple.h: (WTF::CompactPointerTuple::encodeType): Deleted. (WTF::CompactPointerTuple::decodeType): Deleted. (WTF::CompactPointerTuple::CompactPointerTuple): Deleted. (WTF::CompactPointerTuple::pointer const): Deleted. (WTF::CompactPointerTuple::setPointer): Deleted. (WTF::CompactPointerTuple::type const): Deleted. (WTF::CompactPointerTuple::setType): Deleted. * wtf/CompilationThread.h: (WTF::CompilationScope::CompilationScope): Deleted. (WTF::CompilationScope::~CompilationScope): Deleted. (WTF::CompilationScope::leaveEarly): Deleted. * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): (WTF::Detail::CallableWrapper<CompletionHandler<Out): (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted. * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::growExact): Deleted. (WTF::ConcurrentBuffer::grow): Deleted. (WTF::ConcurrentBuffer::array const): Deleted. (WTF::ConcurrentBuffer::operator[]): Deleted. (WTF::ConcurrentBuffer::operator[] const): Deleted. (WTF::ConcurrentBuffer::createArray): Deleted. * wtf/ConcurrentPtrHashSet.h: (WTF::ConcurrentPtrHashSet::contains): Deleted. (WTF::ConcurrentPtrHashSet::add): Deleted. (WTF::ConcurrentPtrHashSet::size const): Deleted. (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted. (WTF::ConcurrentPtrHashSet::hash): Deleted. (WTF::ConcurrentPtrHashSet::cast): Deleted. (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted. (WTF::ConcurrentPtrHashSet::addImpl): Deleted. * wtf/ConcurrentVector.h: (WTF::ConcurrentVector::~ConcurrentVector): Deleted. (WTF::ConcurrentVector::size const): Deleted. (WTF::ConcurrentVector::isEmpty const): Deleted. (WTF::ConcurrentVector::at): Deleted. (WTF::ConcurrentVector::at const): Deleted. (WTF::ConcurrentVector::operator[]): Deleted. (WTF::ConcurrentVector::operator[] const): Deleted. (WTF::ConcurrentVector::first): Deleted. (WTF::ConcurrentVector::first const): Deleted. (WTF::ConcurrentVector::last): Deleted. (WTF::ConcurrentVector::last const): Deleted. (WTF::ConcurrentVector::takeLast): Deleted. (WTF::ConcurrentVector::append): Deleted. (WTF::ConcurrentVector::alloc): Deleted. (WTF::ConcurrentVector::removeLast): Deleted. (WTF::ConcurrentVector::grow): Deleted. (WTF::ConcurrentVector::begin): Deleted. (WTF::ConcurrentVector::end): Deleted. (WTF::ConcurrentVector::segmentExistsFor): Deleted. (WTF::ConcurrentVector::segmentFor): Deleted. (WTF::ConcurrentVector::subscriptFor): Deleted. (WTF::ConcurrentVector::ensureSegmentsFor): Deleted. (WTF::ConcurrentVector::ensureSegment): Deleted. (WTF::ConcurrentVector::allocateSegment): Deleted. * wtf/Condition.h: (WTF::Condition::waitUntil): Deleted. (WTF::Condition::waitFor): Deleted. (WTF::Condition::wait): Deleted. (WTF::Condition::notifyOne): Deleted. (WTF::Condition::notifyAll): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::LockHooks::lockHook): Deleted. (WTF::CountingLock::LockHooks::unlockHook): Deleted. (WTF::CountingLock::LockHooks::parkHook): Deleted. (WTF::CountingLock::LockHooks::handoffHook): Deleted. (WTF::CountingLock::tryLock): Deleted. (WTF::CountingLock::lock): Deleted. (WTF::CountingLock::unlock): Deleted. (WTF::CountingLock::isHeld const): Deleted. (WTF::CountingLock::isLocked const): Deleted. (WTF::CountingLock::Count::operator bool const): Deleted. (WTF::CountingLock::Count::operator== const): Deleted. (WTF::CountingLock::Count::operator!= const): Deleted. (WTF::CountingLock::tryOptimisticRead): Deleted. (WTF::CountingLock::validate): Deleted. (WTF::CountingLock::doOptimizedRead): Deleted. (WTF::CountingLock::tryOptimisticFencelessRead): Deleted. (WTF::CountingLock::fencelessValidate): Deleted. (WTF::CountingLock::doOptimizedFencelessRead): Deleted. (WTF::CountingLock::getCount): Deleted. * wtf/CrossThreadQueue.h: * wtf/CrossThreadTask.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/DataMutex.h: * wtf/DateMath.h: * wtf/Deque.h: (WTF::Deque::size const): Deleted. (WTF::Deque::isEmpty const): Deleted. (WTF::Deque::begin): Deleted. (WTF::Deque::end): Deleted. (WTF::Deque::begin const): Deleted. (WTF::Deque::end const): Deleted. (WTF::Deque::rbegin): Deleted. (WTF::Deque::rend): Deleted. (WTF::Deque::rbegin const): Deleted. (WTF::Deque::rend const): Deleted. (WTF::Deque::first): Deleted. (WTF::Deque::first const): Deleted. (WTF::Deque::last): Deleted. (WTF::Deque::last const): Deleted. (WTF::Deque::append): Deleted. * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/Expected.h: * wtf/FastBitVector.h: * wtf/FileMetadata.h: * wtf/FileSystem.h: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.h: (WTF::GregorianDateTime::GregorianDateTime): Deleted. (WTF::GregorianDateTime::year const): Deleted. (WTF::GregorianDateTime::month const): Deleted. (WTF::GregorianDateTime::yearDay const): Deleted. (WTF::GregorianDateTime::monthDay const): Deleted. (WTF::GregorianDateTime::weekDay const): Deleted. (WTF::GregorianDateTime::hour const): Deleted. (WTF::GregorianDateTime::minute const): Deleted. (WTF::GregorianDateTime::second const): Deleted. (WTF::GregorianDateTime::utcOffset const): Deleted. (WTF::GregorianDateTime::isDST const): Deleted. (WTF::GregorianDateTime::setYear): Deleted. (WTF::GregorianDateTime::setMonth): Deleted. (WTF::GregorianDateTime::setYearDay): Deleted. (WTF::GregorianDateTime::setMonthDay): Deleted. (WTF::GregorianDateTime::setWeekDay): Deleted. (WTF::GregorianDateTime::setHour): Deleted. (WTF::GregorianDateTime::setMinute): Deleted. (WTF::GregorianDateTime::setSecond): Deleted. (WTF::GregorianDateTime::setUtcOffset): Deleted. (WTF::GregorianDateTime::setIsDST): Deleted. (WTF::GregorianDateTime::operator tm const): Deleted. (WTF::GregorianDateTime::copyFrom): Deleted. * wtf/HashTable.h: * wtf/Hasher.h: * wtf/HexNumber.h: * wtf/Indenter.h: * wtf/IndexMap.h: * wtf/IndexSet.h: * wtf/IndexSparseSet.h: * wtf/IndexedContainerIterator.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/KeyValuePair.h: * wtf/ListHashSet.h: (WTF::ListHashSet::begin): Deleted. (WTF::ListHashSet::end): Deleted. (WTF::ListHashSet::begin const): Deleted. (WTF::ListHashSet::end const): Deleted. (WTF::ListHashSet::random): Deleted. (WTF::ListHashSet::random const): Deleted. (WTF::ListHashSet::rbegin): Deleted. (WTF::ListHashSet::rend): Deleted. (WTF::ListHashSet::rbegin const): Deleted. (WTF::ListHashSet::rend const): Deleted. * wtf/Liveness.h: * wtf/LocklessBag.h: (WTF::LocklessBag::LocklessBag): Deleted. (WTF::LocklessBag::add): Deleted. (WTF::LocklessBag::iterate): Deleted. (WTF::LocklessBag::consumeAll): Deleted. (WTF::LocklessBag::consumeAllWithNode): Deleted. (WTF::LocklessBag::~LocklessBag): Deleted. * wtf/LoggingHashID.h: * wtf/MD5.h: * wtf/MachSendRight.h: * wtf/MainThreadData.h: * wtf/Markable.h: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.h: * wtf/MessageQueue.h: (WTF::MessageQueue::MessageQueue): Deleted. * wtf/MetaAllocator.h: * wtf/MonotonicTime.h: (WTF::MonotonicTime::MonotonicTime): Deleted. (WTF::MonotonicTime::fromRawSeconds): Deleted. (WTF::MonotonicTime::infinity): Deleted. (WTF::MonotonicTime::nan): Deleted. (WTF::MonotonicTime::secondsSinceEpoch const): Deleted. (WTF::MonotonicTime::approximateMonotonicTime const): Deleted. (WTF::MonotonicTime::operator bool const): Deleted. (WTF::MonotonicTime::operator+ const): Deleted. (WTF::MonotonicTime::operator- const): Deleted. (WTF::MonotonicTime::operator% const): Deleted. (WTF::MonotonicTime::operator+=): Deleted. (WTF::MonotonicTime::operator-=): Deleted. (WTF::MonotonicTime::operator== const): Deleted. (WTF::MonotonicTime::operator!= const): Deleted. (WTF::MonotonicTime::operator< const): Deleted. (WTF::MonotonicTime::operator> const): Deleted. (WTF::MonotonicTime::operator<= const): Deleted. (WTF::MonotonicTime::operator>= const): Deleted. (WTF::MonotonicTime::isolatedCopy const): Deleted. (WTF::MonotonicTime::encode const): Deleted. (WTF::MonotonicTime::decode): Deleted. * wtf/NaturalLoops.h: * wtf/NoLock.h: * wtf/OSAllocator.h: * wtf/OptionSet.h: * wtf/Optional.h: * wtf/OrderMaker.h: * wtf/Packed.h: (WTF::alignof): * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): Deleted. (WTF::PackedIntVector::operator=): Deleted. (WTF::PackedIntVector::size const): Deleted. (WTF::PackedIntVector::ensureSize): Deleted. (WTF::PackedIntVector::resize): Deleted. (WTF::PackedIntVector::clearAll): Deleted. (WTF::PackedIntVector::get const): Deleted. (WTF::PackedIntVector::set): Deleted. (WTF::PackedIntVector::mask): Deleted. * wtf/PageBlock.h: * wtf/ParallelJobsOpenMP.h: * wtf/ParkingLot.h: * wtf/PriorityQueue.h: (WTF::PriorityQueue::size const): Deleted. (WTF::PriorityQueue::isEmpty const): Deleted. (WTF::PriorityQueue::enqueue): Deleted. (WTF::PriorityQueue::peek const): Deleted. (WTF::PriorityQueue::dequeue): Deleted. (WTF::PriorityQueue::decreaseKey): Deleted. (WTF::PriorityQueue::increaseKey): Deleted. (WTF::PriorityQueue::begin const): Deleted. (WTF::PriorityQueue::end const): Deleted. (WTF::PriorityQueue::isValidHeap const): Deleted. (WTF::PriorityQueue::parentOf): Deleted. (WTF::PriorityQueue::leftChildOf): Deleted. (WTF::PriorityQueue::rightChildOf): Deleted. (WTF::PriorityQueue::siftUp): Deleted. (WTF::PriorityQueue::siftDown): Deleted. * wtf/RandomDevice.h: * wtf/Range.h: * wtf/RangeSet.h: (WTF::RangeSet::RangeSet): Deleted. (WTF::RangeSet::~RangeSet): Deleted. (WTF::RangeSet::add): Deleted. (WTF::RangeSet::contains const): Deleted. (WTF::RangeSet::overlaps const): Deleted. (WTF::RangeSet::clear): Deleted. (WTF::RangeSet::dump const): Deleted. (WTF::RangeSet::dumpRaw const): Deleted. (WTF::RangeSet::begin const): Deleted. (WTF::RangeSet::end const): Deleted. (WTF::RangeSet::addAll): Deleted. (WTF::RangeSet::compact): Deleted. (WTF::RangeSet::overlapsNonEmpty): Deleted. (WTF::RangeSet::subsumesNonEmpty): Deleted. (WTF::RangeSet::findRange const): Deleted. * wtf/RecursableLambda.h: * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor const): Deleted. (WTF::RedBlackTree::Node::predecessor const): Deleted. (WTF::RedBlackTree::Node::successor): Deleted. (WTF::RedBlackTree::Node::predecessor): Deleted. (WTF::RedBlackTree::Node::reset): Deleted. (WTF::RedBlackTree::Node::parent const): Deleted. (WTF::RedBlackTree::Node::setParent): Deleted. (WTF::RedBlackTree::Node::left const): Deleted. (WTF::RedBlackTree::Node::setLeft): Deleted. (WTF::RedBlackTree::Node::right const): Deleted. (WTF::RedBlackTree::Node::setRight): Deleted. (WTF::RedBlackTree::Node::color const): Deleted. (WTF::RedBlackTree::Node::setColor): Deleted. (WTF::RedBlackTree::RedBlackTree): Deleted. (WTF::RedBlackTree::insert): Deleted. (WTF::RedBlackTree::remove): Deleted. (WTF::RedBlackTree::findExact const): Deleted. (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted. (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted. (WTF::RedBlackTree::first const): Deleted. (WTF::RedBlackTree::last const): Deleted. (WTF::RedBlackTree::size): Deleted. (WTF::RedBlackTree::isEmpty): Deleted. (WTF::RedBlackTree::treeMinimum): Deleted. (WTF::RedBlackTree::treeMaximum): Deleted. (WTF::RedBlackTree::treeInsert): Deleted. (WTF::RedBlackTree::leftRotate): Deleted. (WTF::RedBlackTree::rightRotate): Deleted. (WTF::RedBlackTree::removeFixup): Deleted. * wtf/ResourceUsage.h: * wtf/RunLoop.cpp: * wtf/RunLoopTimer.h: * wtf/SHA1.h: * wtf/Seconds.h: (WTF::Seconds::Seconds): Deleted. (WTF::Seconds::value const): Deleted. (WTF::Seconds::minutes const): Deleted. (WTF::Seconds::seconds const): Deleted. (WTF::Seconds::milliseconds const): Deleted. (WTF::Seconds::microseconds const): Deleted. (WTF::Seconds::nanoseconds const): Deleted. (WTF::Seconds::minutesAs const): Deleted. (WTF::Seconds::secondsAs const): Deleted. (WTF::Seconds::millisecondsAs const): Deleted. (WTF::Seconds::microsecondsAs const): Deleted. (WTF::Seconds::nanosecondsAs const): Deleted. (WTF::Seconds::fromMinutes): Deleted. (WTF::Seconds::fromHours): Deleted. (WTF::Seconds::fromMilliseconds): Deleted. (WTF::Seconds::fromMicroseconds): Deleted. (WTF::Seconds::fromNanoseconds): Deleted. (WTF::Seconds::infinity): Deleted. (WTF::Seconds::nan): Deleted. (WTF::Seconds::operator bool const): Deleted. (WTF::Seconds::operator+ const): Deleted. (WTF::Seconds::operator- const): Deleted. (WTF::Seconds::operator* const): Deleted. (WTF::Seconds::operator/ const): Deleted. (WTF::Seconds::operator% const): Deleted. (WTF::Seconds::operator+=): Deleted. (WTF::Seconds::operator-=): Deleted. (WTF::Seconds::operator*=): Deleted. (WTF::Seconds::operator/=): Deleted. (WTF::Seconds::operator%=): Deleted. (WTF::Seconds::operator== const): Deleted. (WTF::Seconds::operator!= const): Deleted. (WTF::Seconds::operator< const): Deleted. (WTF::Seconds::operator> const): Deleted. (WTF::Seconds::operator<= const): Deleted. (WTF::Seconds::operator>= const): Deleted. (WTF::Seconds::isolatedCopy const): Deleted. (WTF::Seconds::encode const): Deleted. (WTF::Seconds::decode): Deleted. * wtf/SegmentedVector.h: (WTF::SegmentedVector::~SegmentedVector): Deleted. (WTF::SegmentedVector::size const): Deleted. (WTF::SegmentedVector::isEmpty const): Deleted. (WTF::SegmentedVector::at): Deleted. (WTF::SegmentedVector::at const): Deleted. (WTF::SegmentedVector::operator[]): Deleted. (WTF::SegmentedVector::operator[] const): Deleted. (WTF::SegmentedVector::first): Deleted. (WTF::SegmentedVector::first const): Deleted. (WTF::SegmentedVector::last): Deleted. (WTF::SegmentedVector::last const): Deleted. (WTF::SegmentedVector::takeLast): Deleted. (WTF::SegmentedVector::append): Deleted. (WTF::SegmentedVector::alloc): Deleted. (WTF::SegmentedVector::removeLast): Deleted. (WTF::SegmentedVector::grow): Deleted. (WTF::SegmentedVector::clear): Deleted. (WTF::SegmentedVector::begin): Deleted. (WTF::SegmentedVector::end): Deleted. (WTF::SegmentedVector::shrinkToFit): Deleted. (WTF::SegmentedVector::deleteAllSegments): Deleted. (WTF::SegmentedVector::segmentExistsFor): Deleted. (WTF::SegmentedVector::segmentFor): Deleted. (WTF::SegmentedVector::subscriptFor): Deleted. (WTF::SegmentedVector::ensureSegmentsFor): Deleted. (WTF::SegmentedVector::ensureSegment): Deleted. (WTF::SegmentedVector::allocateSegment): Deleted. * wtf/SetForScope.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SmallPtrSet.h: * wtf/SpanningTree.h: * wtf/Spectrum.h: * wtf/StackBounds.h: * wtf/StackShot.h: * wtf/StackShotProfiler.h: * wtf/StackStats.h: * wtf/StackTrace.h: * wtf/StreamBuffer.h: * wtf/SynchronizedFixedQueue.h: (WTF::SynchronizedFixedQueue::create): Deleted. (WTF::SynchronizedFixedQueue::open): Deleted. (WTF::SynchronizedFixedQueue::close): Deleted. (WTF::SynchronizedFixedQueue::isOpen): Deleted. (WTF::SynchronizedFixedQueue::enqueue): Deleted. (WTF::SynchronizedFixedQueue::dequeue): Deleted. (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted. * wtf/SystemTracing.h: * wtf/ThreadGroup.h: (WTF::ThreadGroup::create): Deleted. (WTF::ThreadGroup::threads const): Deleted. (WTF::ThreadGroup::getLock): Deleted. (WTF::ThreadGroup::weakFromThis): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingPrimitives.h: (WTF::Mutex::impl): Deleted. * wtf/TimeWithDynamicClockType.h: (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted. (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted. (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted. (WTF::TimeWithDynamicClockType::clockType const): Deleted. (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted. (WTF::TimeWithDynamicClockType::operator bool const): Deleted. (WTF::TimeWithDynamicClockType::operator+ const): Deleted. (WTF::TimeWithDynamicClockType::operator- const): Deleted. (WTF::TimeWithDynamicClockType::operator+=): Deleted. (WTF::TimeWithDynamicClockType::operator-=): Deleted. (WTF::TimeWithDynamicClockType::operator== const): Deleted. (WTF::TimeWithDynamicClockType::operator!= const): Deleted. * wtf/TimingScope.h: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/URLParser.cpp: * wtf/URLParser.h: * wtf/Unexpected.h: * wtf/Variant.h: * wtf/WTFSemaphore.h: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::signal): Deleted. (WTF::Semaphore::waitUntil): Deleted. (WTF::Semaphore::waitFor): Deleted. (WTF::Semaphore::wait): Deleted. * wtf/WallTime.h: (WTF::WallTime::WallTime): Deleted. (WTF::WallTime::fromRawSeconds): Deleted. (WTF::WallTime::infinity): Deleted. (WTF::WallTime::nan): Deleted. (WTF::WallTime::secondsSinceEpoch const): Deleted. (WTF::WallTime::approximateWallTime const): Deleted. (WTF::WallTime::operator bool const): Deleted. (WTF::WallTime::operator+ const): Deleted. (WTF::WallTime::operator- const): Deleted. (WTF::WallTime::operator+=): Deleted. (WTF::WallTime::operator-=): Deleted. (WTF::WallTime::operator== const): Deleted. (WTF::WallTime::operator!= const): Deleted. (WTF::WallTime::operator< const): Deleted. (WTF::WallTime::operator> const): Deleted. (WTF::WallTime::operator<= const): Deleted. (WTF::WallTime::operator>= const): Deleted. (WTF::WallTime::isolatedCopy const): Deleted. * wtf/WeakHashSet.h: (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted. (WTF::WeakHashSet::WeakHashSet): Deleted. (WTF::WeakHashSet::begin const): Deleted. (WTF::WeakHashSet::end const): Deleted. (WTF::WeakHashSet::add): Deleted. (WTF::WeakHashSet::remove): Deleted. (WTF::WeakHashSet::contains const): Deleted. (WTF::WeakHashSet::capacity const): Deleted. (WTF::WeakHashSet::computesEmpty const): Deleted. (WTF::WeakHashSet::hasNullReferences const): Deleted. (WTF::WeakHashSet::computeSize const): Deleted. (WTF::WeakHashSet::checkConsistency const): Deleted. * wtf/WeakRandom.h: (WTF::WeakRandom::WeakRandom): Deleted. (WTF::WeakRandom::setSeed): Deleted. (WTF::WeakRandom::seed const): Deleted. (WTF::WeakRandom::get): Deleted. (WTF::WeakRandom::getUint32): Deleted. (WTF::WeakRandom::lowOffset): Deleted. (WTF::WeakRandom::highOffset): Deleted. (WTF::WeakRandom::nextState): Deleted. (WTF::WeakRandom::generate): Deleted. (WTF::WeakRandom::advance): Deleted. * wtf/WordLock.h: (WTF::WordLock::lock): Deleted. (WTF::WordLock::unlock): Deleted. (WTF::WordLock::isHeld const): Deleted. (WTF::WordLock::isLocked const): Deleted. (WTF::WordLock::isFullyReset const): Deleted. * wtf/generic/MainThreadGeneric.cpp: * wtf/glib/GMutexLocker.h: * wtf/linux/CurrentProcessMemoryStatus.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::~Semaphore): Deleted. (WTF::Semaphore::wait): Deleted. (WTF::Semaphore::post): Deleted. * wtf/text/ASCIILiteral.h: (WTF::ASCIILiteral::operator const char* const): Deleted. (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted. (WTF::ASCIILiteral::null): Deleted. (WTF::ASCIILiteral::characters const): Deleted. (WTF::ASCIILiteral::ASCIILiteral): Deleted. * wtf/text/AtomString.h: (WTF::AtomString::operator=): Deleted. (WTF::AtomString::isHashTableDeletedValue const): Deleted. (WTF::AtomString::existingHash const): Deleted. (WTF::AtomString::operator const String& const): Deleted. (WTF::AtomString::string const): Deleted. (WTF::AtomString::impl const): Deleted. (WTF::AtomString::is8Bit const): Deleted. (WTF::AtomString::characters8 const): Deleted. (WTF::AtomString::characters16 const): Deleted. (WTF::AtomString::length const): Deleted. (WTF::AtomString::operator[] const): Deleted. (WTF::AtomString::contains const): Deleted. (WTF::AtomString::containsIgnoringASCIICase const): Deleted. (WTF::AtomString::find const): Deleted. (WTF::AtomString::findIgnoringASCIICase const): Deleted. (WTF::AtomString::startsWith const): Deleted. (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::endsWith const): Deleted. (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::toInt const): Deleted. (WTF::AtomString::toDouble const): Deleted. (WTF::AtomString::toFloat const): Deleted. (WTF::AtomString::percentage const): Deleted. (WTF::AtomString::isNull const): Deleted. (WTF::AtomString::isEmpty const): Deleted. (WTF::AtomString::operator NSString * const): Deleted. * wtf/text/AtomStringImpl.h: (WTF::AtomStringImpl::lookUp): Deleted. (WTF::AtomStringImpl::add): Deleted. (WTF::AtomStringImpl::addWithStringTableProvider): Deleted. * wtf/text/CString.h: (WTF::CStringBuffer::data): Deleted. (WTF::CStringBuffer::length const): Deleted. (WTF::CStringBuffer::CStringBuffer): Deleted. (WTF::CStringBuffer::mutableData): Deleted. (WTF::CString::CString): Deleted. (WTF::CString::data const): Deleted. (WTF::CString::length const): Deleted. (WTF::CString::isNull const): Deleted. (WTF::CString::buffer const): Deleted. (WTF::CString::isHashTableDeletedValue const): Deleted. * wtf/text/ExternalStringImpl.h: (WTF::ExternalStringImpl::freeExternalBuffer): Deleted. * wtf/text/LineBreakIteratorPoolICU.h: * wtf/text/NullTextBreakIterator.h: * wtf/text/OrdinalNumber.h: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.h: * wtf/text/StringConcatenateNumbers.h: * wtf/text/StringHasher.h: * wtf/text/StringImpl.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: (WTF::StringView::left const): Deleted. (WTF::StringView::right const): Deleted. (WTF::StringView::underlyingStringIsValid const): Deleted. (WTF::StringView::setUnderlyingString): Deleted. * wtf/text/SymbolImpl.h: (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted. (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted. (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted. (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted. (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted. (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted. * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.h: * wtf/text/WTFString.h: (WTF::String::swap): Deleted. (WTF::String::adopt): Deleted. (WTF::String::isNull const): Deleted. (WTF::String::isEmpty const): Deleted. (WTF::String::impl const): Deleted. (WTF::String::releaseImpl): Deleted. (WTF::String::length const): Deleted. (WTF::String::characters8 const): Deleted. (WTF::String::characters16 const): Deleted. (WTF::String::is8Bit const): Deleted. (WTF::String::sizeInBytes const): Deleted. (WTF::String::operator[] const): Deleted. (WTF::String::find const): Deleted. (WTF::String::findIgnoringASCIICase const): Deleted. (WTF::String::reverseFind const): Deleted. (WTF::String::contains const): Deleted. (WTF::String::containsIgnoringASCIICase const): Deleted. (WTF::String::startsWith const): Deleted. (WTF::String::startsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixStartingAt const): Deleted. (WTF::String::endsWith const): Deleted. (WTF::String::endsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixEndingAt const): Deleted. (WTF::String::append): Deleted. (WTF::String::left const): Deleted. (WTF::String::right const): Deleted. (WTF::String::createUninitialized): Deleted. (WTF::String::fromUTF8WithLatin1Fallback): Deleted. (WTF::String::isAllASCII const): Deleted. (WTF::String::isAllLatin1 const): Deleted. (WTF::String::isSpecialCharacter const): Deleted. (WTF::String::isHashTableDeletedValue const): Deleted. (WTF::String::hash const): Deleted. (WTF::String::existingHash const): Deleted. * wtf/text/cf/TextBreakIteratorCF.h: * wtf/text/icu/TextBreakIteratorICU.h: * wtf/text/icu/UTextProviderLatin1.h: * wtf/threads/BinarySemaphore.h: (WTF::BinarySemaphore::waitFor): Deleted. (WTF::BinarySemaphore::wait): Deleted. * wtf/unicode/Collator.h: * wtf/win/GDIObject.h: * wtf/win/PathWalker.h: * wtf/win/Win32Handle.h: Canonical link: https://commits.webkit.org/214396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-12 20:57:15 +00:00
WTF_MAKE_FAST_ALLOCATED;
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
public:
Make createCrossThreadTask() functions return on the stack instead of the heap. https://bugs.webkit.org/show_bug.cgi?id=158215 Reviewed by Darin Adler. Source/WebCore: No new tests (Refactor, no change in behavior). * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::postDatabaseTask): (WebCore::IDBServer::IDBServer::postDatabaseTaskReply): (WebCore::IDBServer::IDBServer::databaseRunLoop): * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask): (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply): * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::postCrossThreadTask): * fileapi/ThreadableBlobRegistry.cpp: (WebCore::threadableQueue): Source/WebKit2: * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): (WebKit::DatabaseProcess::fetchWebsiteData): * DatabaseProcess/DatabaseProcess.h: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CrossThreadCopier.cpp: * wtf/CrossThreadQueue.h: Added. A lightweight of MessageQueue that deals directly in objects instead of in std::unique_ptrs. (WTF::CrossThreadQueue::isKilled): (WTF::CrossThreadQueue<DataType>::append): (WTF::CrossThreadQueue<DataType>::waitForMessage): (WTF::CrossThreadQueue<DataType>::tryGetMessage): * wtf/CrossThreadTask.h: (WTF::createCrossThreadTask): (WTF::CrossThreadTask::CrossThreadTask): Deleted. Canonical link: https://commits.webkit.org/176314@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 19:33:22 +00:00
CrossThreadTask() = default;
Rename NoncopyableFunction to Function https://bugs.webkit.org/show_bug.cgi?id=158354 Reviewed by Chris Dumez. Source/WebCore: * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::runTask): * Modules/mediastream/MediaEndpointPeerConnection.h: * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::resume): (WebCore::AudioDestinationNode::suspend): (WebCore::AudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.h: * dom/ActiveDOMCallbackMicrotask.cpp: (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask): * dom/ActiveDOMCallbackMicrotask.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::Task::Task): * fileapi/AsyncFileStream.cpp: (WebCore::callOnFileThread): (WebCore::AsyncFileStream::perform): * fileapi/AsyncFileStream.h: * page/FrameView.cpp: (WebCore::FrameView::queuePostLayoutCallback): (WebCore::FrameView::flushPostLayoutTasksQueue): * page/FrameView.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::dispatch): (WebCore::ScrollingThread::dispatchBarrier): (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread): * page/scrolling/ScrollingThread.h: * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): * platform/GenericTaskQueue.h: (WebCore::TaskDispatcher::postTask): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::scheduleDeferredTask): * style/StyleTreeResolver.cpp: (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::queuePostResolutionCallback): * style/StyleTreeResolver.h: Source/WebKit: * Storage/StorageSyncManager.cpp: (WebCore::StorageSyncManager::dispatch): * Storage/StorageSyncManager.h: * Storage/StorageThread.cpp: (WebCore::StorageThread::dispatch): (WebCore::StorageThread::terminate): * Storage/StorageThread.h: Source/WebKit2: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * NetworkProcess/cache/NetworkCacheStorage.h: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CrossThreadTask.h: (WTF::CrossThreadTask::CrossThreadTask): * wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h. * wtf/FunctionDispatcher.h: * wtf/MainThread.cpp: (WTF::functionQueue): (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/MainThread.h: * wtf/RunLoop.cpp: (WTF::RunLoop::performWork): (WTF::RunLoop::dispatch): * wtf/RunLoop.h: * wtf/WorkQueue.h: * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/efl/DispatchQueueWorkItemEfl.h: (WorkItem::WorkItem): (TimerWorkItem::create): (TimerWorkItem::TimerWorkItem): * wtf/efl/WorkQueueEfl.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/generic/RunLoopGeneric.cpp: (WTF::RunLoop::TimerBase::ScheduledTask::create): (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask): (WTF::RunLoop::dispatchAfter): * wtf/generic/WorkQueueGeneric.cpp: (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * wtf/glib/RunLoopGLib.cpp: (WTF::DispatchAfterContext::DispatchAfterContext): (WTF::RunLoop::dispatchAfter): * wtf/win/WorkItemWin.cpp: (WTF::WorkItemWin::WorkItemWin): (WTF::WorkItemWin::create): (WTF::HandleWorkItem::HandleWorkItem): (WTF::HandleWorkItem::createByAdoptingHandle): * wtf/win/WorkItemWin.h: (WTF::WorkItemWin::function): * wtf/win/WorkQueueWin.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): Canonical link: https://commits.webkit.org/177198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-24 19:40:19 +00:00
CrossThreadTask(Function<void ()>&& taskFunction)
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
: m_taskFunction(WTFMove(taskFunction))
Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements. https://bugs.webkit.org/show_bug.cgi?id=137993 Reviewed by Brady Eidson. To allow different ChildProcess subclasses to handle listing and deletion of origin data, make WebOriginDataManager more generic by having a supplement implement the details, leaving WebOriginDataManager to deal with cross-process messaging. De-virtualize AsyncTask, allowing a task to be created by passing in a function<void()>, rather than an object, method, and arguments. * Shared/AsyncTask.h: (WebKit::AsyncTask::AsyncTask): (WebKit::AsyncTask::performTask): (WebKit::AsyncTask::~AsyncTask): Deleted. Add a new virtual base class, to be implemented by various ChildProcesses, which WebOriginDataManager will use to implement listing and deletion requests. * WebProcess/OriginData/WebOriginDataManager.h: * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added. (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::getOrigins): (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerSupplement::deleteAllEntries): * WebKit2.xcodeproj/project.pbxproj: WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess- specific implementations for its message handlers and replace with clean, generic calls to its supplement. Because these supplements may want to respond to the request asynchronously, pass a completion function in to be called by the supplement once its work is complete. * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::WebOriginDataManager): (WebKit::WebOriginDataManager::getOrigins): (WebKit::WebOriginDataManager::deleteEntriesForOrigin): (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManager::deleteAllEntries): (WebKit::WebOriginDataManager::supplementName): Deleted. DatabaseProcess already uses WebOriginDataManager, so it will be the first process to fall under the heel of the new regime. DatabaseProcess will subclass WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager constructor. Create a lambda-based AsyncTask for each request, and call the completion function when each request is complete. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): (WebKit::DatabaseProcess::getOrigins): (WebKit::DatabaseProcess::deleteEntriesForOrigin): (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllEntries): (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted. (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted. * DatabaseProcess/DatabaseProcess.h: Canonical link: https://commits.webkit.org/155925@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-24 23:01:54 +00:00
{
ASSERT(m_taskFunction);
Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements. https://bugs.webkit.org/show_bug.cgi?id=137993 Reviewed by Brady Eidson. To allow different ChildProcess subclasses to handle listing and deletion of origin data, make WebOriginDataManager more generic by having a supplement implement the details, leaving WebOriginDataManager to deal with cross-process messaging. De-virtualize AsyncTask, allowing a task to be created by passing in a function<void()>, rather than an object, method, and arguments. * Shared/AsyncTask.h: (WebKit::AsyncTask::AsyncTask): (WebKit::AsyncTask::performTask): (WebKit::AsyncTask::~AsyncTask): Deleted. Add a new virtual base class, to be implemented by various ChildProcesses, which WebOriginDataManager will use to implement listing and deletion requests. * WebProcess/OriginData/WebOriginDataManager.h: * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added. (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::getOrigins): (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerSupplement::deleteAllEntries): * WebKit2.xcodeproj/project.pbxproj: WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess- specific implementations for its message handlers and replace with clean, generic calls to its supplement. Because these supplements may want to respond to the request asynchronously, pass a completion function in to be called by the supplement once its work is complete. * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::WebOriginDataManager): (WebKit::WebOriginDataManager::getOrigins): (WebKit::WebOriginDataManager::deleteEntriesForOrigin): (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManager::deleteAllEntries): (WebKit::WebOriginDataManager::supplementName): Deleted. DatabaseProcess already uses WebOriginDataManager, so it will be the first process to fall under the heel of the new regime. DatabaseProcess will subclass WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager constructor. Create a lambda-based AsyncTask for each request, and call the completion function when each request is complete. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): (WebKit::DatabaseProcess::getOrigins): (WebKit::DatabaseProcess::deleteEntriesForOrigin): (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllEntries): (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted. (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted. * DatabaseProcess/DatabaseProcess.h: Canonical link: https://commits.webkit.org/155925@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-24 23:01:54 +00:00
}
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
Abstractify WebOriginDataManager to support arbitrary ChildProcess supplements. https://bugs.webkit.org/show_bug.cgi?id=137993 Reviewed by Brady Eidson. To allow different ChildProcess subclasses to handle listing and deletion of origin data, make WebOriginDataManager more generic by having a supplement implement the details, leaving WebOriginDataManager to deal with cross-process messaging. De-virtualize AsyncTask, allowing a task to be created by passing in a function<void()>, rather than an object, method, and arguments. * Shared/AsyncTask.h: (WebKit::AsyncTask::AsyncTask): (WebKit::AsyncTask::performTask): (WebKit::AsyncTask::~AsyncTask): Deleted. Add a new virtual base class, to be implemented by various ChildProcesses, which WebOriginDataManager will use to implement listing and deletion requests. * WebProcess/OriginData/WebOriginDataManager.h: * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Added. (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): (WebKit::WebOriginDataManagerSupplement::getOrigins): (WebKit::WebOriginDataManagerSupplement::deleteEntriesForOrigin): (WebKit::WebOriginDataManagerSupplement::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManagerSupplement::deleteAllEntries): * WebKit2.xcodeproj/project.pbxproj: WebOriginDataManager doesn't need to be a ChildSupplement. Remove the DatabaseProcess- specific implementations for its message handlers and replace with clean, generic calls to its supplement. Because these supplements may want to respond to the request asynchronously, pass a completion function in to be called by the supplement once its work is complete. * WebProcess/OriginData/WebOriginDataManager.cpp: (WebKit::WebOriginDataManager::WebOriginDataManager): (WebKit::WebOriginDataManager::getOrigins): (WebKit::WebOriginDataManager::deleteEntriesForOrigin): (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): (WebKit::WebOriginDataManager::deleteAllEntries): (WebKit::WebOriginDataManager::supplementName): Deleted. DatabaseProcess already uses WebOriginDataManager, so it will be the first process to fall under the heel of the new regime. DatabaseProcess will subclass WebOriginDataManagerSupplement, and pass itself in twice to the WebOriginDataManager constructor. Create a lambda-based AsyncTask for each request, and call the completion function when each request is complete. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::DatabaseProcess): (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): (WebKit::DatabaseProcess::getOrigins): (WebKit::DatabaseProcess::deleteEntriesForOrigin): (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): (WebKit::DatabaseProcess::deleteAllEntries): (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin): Deleted. (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted. (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries): Deleted. * DatabaseProcess/DatabaseProcess.h: Canonical link: https://commits.webkit.org/155925@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-24 23:01:54 +00:00
void performTask()
{
m_taskFunction();
}
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
explicit operator bool() const { return !!m_taskFunction; }
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
protected:
Rename NoncopyableFunction to Function https://bugs.webkit.org/show_bug.cgi?id=158354 Reviewed by Chris Dumez. Source/WebCore: * Modules/mediastream/MediaEndpointPeerConnection.cpp: (WebCore::MediaEndpointPeerConnection::runTask): * Modules/mediastream/MediaEndpointPeerConnection.h: * Modules/webaudio/AudioDestinationNode.h: (WebCore::AudioDestinationNode::resume): (WebCore::AudioDestinationNode::suspend): (WebCore::AudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.cpp: (WebCore::DefaultAudioDestinationNode::resume): (WebCore::DefaultAudioDestinationNode::suspend): (WebCore::DefaultAudioDestinationNode::close): * Modules/webaudio/DefaultAudioDestinationNode.h: * dom/ActiveDOMCallbackMicrotask.cpp: (WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask): * dom/ActiveDOMCallbackMicrotask.h: * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::Task::Task): * fileapi/AsyncFileStream.cpp: (WebCore::callOnFileThread): (WebCore::AsyncFileStream::perform): * fileapi/AsyncFileStream.h: * page/FrameView.cpp: (WebCore::FrameView::queuePostLayoutCallback): (WebCore::FrameView::flushPostLayoutTasksQueue): * page/FrameView.h: * page/scrolling/ScrollingThread.cpp: (WebCore::ScrollingThread::dispatch): (WebCore::ScrollingThread::dispatchBarrier): (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread): * page/scrolling/ScrollingThread.h: * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): * platform/GenericTaskQueue.h: (WebCore::TaskDispatcher::postTask): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::scheduleDeferredTask): * platform/mediastream/MediaStreamPrivate.h: * platform/mediastream/mac/AVMediaCaptureSource.h: * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::scheduleDeferredTask): * style/StyleTreeResolver.cpp: (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::queuePostResolutionCallback): * style/StyleTreeResolver.h: Source/WebKit: * Storage/StorageSyncManager.cpp: (WebCore::StorageSyncManager::dispatch): * Storage/StorageSyncManager.h: * Storage/StorageThread.cpp: (WebCore::StorageThread::dispatch): (WebCore::StorageThread::terminate): * Storage/StorageThread.h: Source/WebKit2: * NetworkProcess/NetworkProcess.cpp: (WebKit::fetchDiskCacheEntries): (WebKit::NetworkProcess::fetchWebsiteData): (WebKit::clearDiskCacheEntries): * NetworkProcess/NetworkProcess.h: * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::traverse): * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: (WebKit::NetworkCache::runTaskInQueue): * NetworkProcess/cache/NetworkCacheStorage.h: Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CrossThreadTask.h: (WTF::CrossThreadTask::CrossThreadTask): * wtf/Function.h: Renamed from Source/WTF/wtf/NoncopyableFunction.h. * wtf/FunctionDispatcher.h: * wtf/MainThread.cpp: (WTF::functionQueue): (WTF::dispatchFunctionsFromMainThread): (WTF::callOnMainThread): * wtf/MainThread.h: * wtf/RunLoop.cpp: (WTF::RunLoop::performWork): (WTF::RunLoop::dispatch): * wtf/RunLoop.h: * wtf/WorkQueue.h: * wtf/cocoa/WorkQueueCocoa.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/efl/DispatchQueueWorkItemEfl.h: (WorkItem::WorkItem): (TimerWorkItem::create): (TimerWorkItem::TimerWorkItem): * wtf/efl/WorkQueueEfl.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): * wtf/generic/RunLoopGeneric.cpp: (WTF::RunLoop::TimerBase::ScheduledTask::create): (WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask): (WTF::RunLoop::dispatchAfter): * wtf/generic/WorkQueueGeneric.cpp: (WorkQueue::dispatch): (WorkQueue::dispatchAfter): * wtf/glib/RunLoopGLib.cpp: (WTF::DispatchAfterContext::DispatchAfterContext): (WTF::RunLoop::dispatchAfter): * wtf/win/WorkItemWin.cpp: (WTF::WorkItemWin::WorkItemWin): (WTF::WorkItemWin::create): (WTF::HandleWorkItem::HandleWorkItem): (WTF::HandleWorkItem::createByAdoptingHandle): * wtf/win/WorkItemWin.h: (WTF::WorkItemWin::function): * wtf/win/WorkQueueWin.cpp: (WTF::WorkQueue::dispatch): (WTF::WorkQueue::dispatchAfter): Canonical link: https://commits.webkit.org/177198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-06-24 19:40:19 +00:00
Function<void ()> m_taskFunction;
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
};
template <typename F, typename ArgsTuple, size_t... ArgsIndex>
void callFunctionForCrossThreadTaskImpl(F function, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
{
function(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))...);
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
}
template <typename F, typename ArgsTuple, typename ArgsIndices = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
void callFunctionForCrossThreadTask(F function, ArgsTuple&& args)
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
{
callFunctionForCrossThreadTaskImpl(function, std::forward<ArgsTuple>(args), ArgsIndices());
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
}
template<typename... Parameters, typename... Arguments>
CrossThreadTask createCrossThreadTask(void (*method)(Parameters...), const Arguments&... arguments)
DatabaseProcess: Pipe through object store IDs and transaction mode for "openTransaction" https://bugs.webkit.org/show_bug.cgi?id=125872 Reviewed by Alexey Proskuryakov. Source/WebCore: Make these enums into enum classes. Add const maximums for each enum class that might be serialized to allow for conversion later: * Modules/indexeddb/IndexedDB.h: Add cross-thread copying for these new enum classes. * platform/CrossThreadCopier.cpp: (WebCore::::copy): * platform/CrossThreadCopier.h: Adopt the new enum classes throughout the rest of WebCore: * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::stringToDirection): (WebCore::IDBCursor::directionToString): * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursorBackend.cpp: (WebCore::IDBCursorBackend::deleteFunction): * Modules/indexeddb/IDBCursorBackend.h: (WebCore::IDBCursorBackend::value): * Modules/indexeddb/IDBDatabaseBackend.cpp: (WebCore::IDBDatabaseBackend::createObjectStore): (WebCore::IDBDatabaseBackend::deleteObjectStore): (WebCore::IDBDatabaseBackend::createIndex): (WebCore::IDBDatabaseBackend::deleteIndex): (WebCore::IDBDatabaseBackend::get): (WebCore::IDBDatabaseBackend::put): (WebCore::IDBDatabaseBackend::setIndexKeys): (WebCore::IDBDatabaseBackend::openCursor): (WebCore::IDBDatabaseBackend::deleteRange): (WebCore::IDBDatabaseBackend::clearObjectStore): (WebCore::IDBDatabaseBackend::transactionStarted): (WebCore::IDBDatabaseBackend::transactionFinished): (WebCore::IDBDatabaseBackend::transactionFinishedAndAbortFired): (WebCore::IDBDatabaseBackend::transactionFinishedAndCompleteFired): (WebCore::IDBDatabaseBackend::createTransaction): (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction): (WebCore::IDBDatabaseBackend::deleteDatabase): * Modules/indexeddb/IDBDatabaseBackend.h: * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::open): (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::onUpgradeNeeded): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::setResultCursor): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::create): (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::stringToMode): (WebCore::IDBTransaction::modeToString): * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/IDBTransactionBackendOperations.cpp: (WebCore::PutOperation::perform): * Modules/indexeddb/IDBTransactionCoordinator.cpp: (WebCore::IDBTransactionCoordinator::processStartedTransactions): (WebCore::IDBTransactionCoordinator::canRunTransaction): * Modules/indexeddb/IDBVersionChangeEvent.h: (WebCore::IDBVersionChangeEvent::create): (WebCore::IDBVersionChangeEvent::newVersion): * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp: (WebCore::objectStoreCursorOptions): (WebCore::indexCursorOptions): * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp: (WebCore::IDBServerConnectionLevelDB::get): (WebCore::IDBServerConnectionLevelDB::openCursor): (WebCore::IDBServerConnectionLevelDB::count): (WebCore::IDBServerConnectionLevelDB::deleteRange): (WebCore::IDBServerConnectionLevelDB::cursorPrefetchIteration): * WebCore.exp.in: Source/WebKit2: Pipe through the objectStoreIDs and mode: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::openTransaction): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Rework postTransactionOperation to take a pre-made AsyncTask to allow for different transaction operation function signatures: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::openTransaction): Pipe through the objectStoreIDs and mode: (WebKit::UniqueIDBDatabase::beginTransaction): (WebKit::UniqueIDBDatabase::commitTransaction): (WebKit::UniqueIDBDatabase::resetTransaction): (WebKit::UniqueIDBDatabase::rollbackTransaction): (WebKit::UniqueIDBDatabase::postTransactionOperation): (WebKit::UniqueIDBDatabase::openBackingStoreTransaction): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Pipe through the objectStoreIDs and mode: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: * Platform/Logging.h: Add an IDB logging channel. * Shared/AsyncTask.h: (WebKit::createAsyncTask): Add a 3-argument variant. * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): Add a Vector<int64_t> copier. * Shared/WebCrossThreadCopier.h: Add logging throughout currently implemented methods: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata): (WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata): (WebKit::WebIDBServerConnection::openTransaction): Pipe through the objectStoreIDs and mode. (WebKit::WebIDBServerConnection::didOpenTransaction): (WebKit::WebIDBServerConnection::beginTransaction): (WebKit::WebIDBServerConnection::didBeginTransaction): (WebKit::WebIDBServerConnection::commitTransaction): (WebKit::WebIDBServerConnection::didCommitTransaction): (WebKit::WebIDBServerConnection::resetTransaction): (WebKit::WebIDBServerConnection::didResetTransaction): (WebKit::WebIDBServerConnection::rollbackTransaction): (WebKit::WebIDBServerConnection::didRollbackTransaction): Canonical link: https://commits.webkit.org/143887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-18 00:12:50 +00:00
{
return CrossThreadTask([method, arguments = std::make_tuple(crossThreadCopy(arguments)...)]() mutable {
callFunctionForCrossThreadTask(method, WTFMove(arguments));
});
DatabaseProcess: Pipe through object store IDs and transaction mode for "openTransaction" https://bugs.webkit.org/show_bug.cgi?id=125872 Reviewed by Alexey Proskuryakov. Source/WebCore: Make these enums into enum classes. Add const maximums for each enum class that might be serialized to allow for conversion later: * Modules/indexeddb/IndexedDB.h: Add cross-thread copying for these new enum classes. * platform/CrossThreadCopier.cpp: (WebCore::::copy): * platform/CrossThreadCopier.h: Adopt the new enum classes throughout the rest of WebCore: * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::continueFunction): (WebCore::IDBCursor::stringToDirection): (WebCore::IDBCursor::directionToString): * Modules/indexeddb/IDBCursor.h: * Modules/indexeddb/IDBCursorBackend.cpp: (WebCore::IDBCursorBackend::deleteFunction): * Modules/indexeddb/IDBCursorBackend.h: (WebCore::IDBCursorBackend::value): * Modules/indexeddb/IDBDatabaseBackend.cpp: (WebCore::IDBDatabaseBackend::createObjectStore): (WebCore::IDBDatabaseBackend::deleteObjectStore): (WebCore::IDBDatabaseBackend::createIndex): (WebCore::IDBDatabaseBackend::deleteIndex): (WebCore::IDBDatabaseBackend::get): (WebCore::IDBDatabaseBackend::put): (WebCore::IDBDatabaseBackend::setIndexKeys): (WebCore::IDBDatabaseBackend::openCursor): (WebCore::IDBDatabaseBackend::deleteRange): (WebCore::IDBDatabaseBackend::clearObjectStore): (WebCore::IDBDatabaseBackend::transactionStarted): (WebCore::IDBDatabaseBackend::transactionFinished): (WebCore::IDBDatabaseBackend::transactionFinishedAndAbortFired): (WebCore::IDBDatabaseBackend::transactionFinishedAndCompleteFired): (WebCore::IDBDatabaseBackend::createTransaction): (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction): (WebCore::IDBDatabaseBackend::deleteDatabase): * Modules/indexeddb/IDBDatabaseBackend.h: * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::open): (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/IDBIndex.cpp: (WebCore::IDBIndex::openCursor): (WebCore::IDBIndex::openKeyCursor): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::openCursor): * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::onUpgradeNeeded): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::IDBRequest): (WebCore::IDBRequest::setResultCursor): (WebCore::IDBRequest::onSuccess): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::create): (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::stringToMode): (WebCore::IDBTransaction::modeToString): * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/IDBTransactionBackendOperations.cpp: (WebCore::PutOperation::perform): * Modules/indexeddb/IDBTransactionCoordinator.cpp: (WebCore::IDBTransactionCoordinator::processStartedTransactions): (WebCore::IDBTransactionCoordinator::canRunTransaction): * Modules/indexeddb/IDBVersionChangeEvent.h: (WebCore::IDBVersionChangeEvent::create): (WebCore::IDBVersionChangeEvent::newVersion): * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp: (WebCore::objectStoreCursorOptions): (WebCore::indexCursorOptions): * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp: (WebCore::IDBServerConnectionLevelDB::get): (WebCore::IDBServerConnectionLevelDB::openCursor): (WebCore::IDBServerConnectionLevelDB::count): (WebCore::IDBServerConnectionLevelDB::deleteRange): (WebCore::IDBServerConnectionLevelDB::cursorPrefetchIteration): * WebCore.exp.in: Source/WebKit2: Pipe through the objectStoreIDs and mode: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::openTransaction): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Rework postTransactionOperation to take a pre-made AsyncTask to allow for different transaction operation function signatures: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::openTransaction): Pipe through the objectStoreIDs and mode: (WebKit::UniqueIDBDatabase::beginTransaction): (WebKit::UniqueIDBDatabase::commitTransaction): (WebKit::UniqueIDBDatabase::resetTransaction): (WebKit::UniqueIDBDatabase::rollbackTransaction): (WebKit::UniqueIDBDatabase::postTransactionOperation): (WebKit::UniqueIDBDatabase::openBackingStoreTransaction): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Pipe through the objectStoreIDs and mode: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: * Platform/Logging.h: Add an IDB logging channel. * Shared/AsyncTask.h: (WebKit::createAsyncTask): Add a 3-argument variant. * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): Add a Vector<int64_t> copier. * Shared/WebCrossThreadCopier.h: Add logging throughout currently implemented methods: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata): (WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata): (WebKit::WebIDBServerConnection::openTransaction): Pipe through the objectStoreIDs and mode. (WebKit::WebIDBServerConnection::didOpenTransaction): (WebKit::WebIDBServerConnection::beginTransaction): (WebKit::WebIDBServerConnection::didBeginTransaction): (WebKit::WebIDBServerConnection::commitTransaction): (WebKit::WebIDBServerConnection::didCommitTransaction): (WebKit::WebIDBServerConnection::resetTransaction): (WebKit::WebIDBServerConnection::didResetTransaction): (WebKit::WebIDBServerConnection::rollbackTransaction): (WebKit::WebIDBServerConnection::didRollbackTransaction): Canonical link: https://commits.webkit.org/143887@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-18 00:12:50 +00:00
}
template <typename C, typename MF, typename ArgsTuple, size_t... ArgsIndex>
void callMemberFunctionForCrossThreadTaskImpl(C* object, MF function, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
Modern IDB (Blob support): Support retrieving Blobs from IDB. https://bugs.webkit.org/show_bug.cgi?id=156367 Reviewed by Alex Christensen. Source/WebCore: No new tests (No testable change in behavior yet, current tests pass). This patch does the following: - Pulls BlobURLs and stored filenames out of IDB whenever an IDB record is fetched. - Adds those URLs and filenames to IDBValue. - Uses IDBValue in more places instead of SharedBuffer/ThreadSafeBuffer. - Teaches SerializedScriptValue, Blob, and File how to read the URLs and filenames when they exist. - Teaches the Blob registry to register a new type of Blob that is not a "File" but is backed by one. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBGetResult.h: (WebCore::IDBGetResult::IDBGetResult): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::setResultToStructuredClone): * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::didGetRecordOnServer): * Modules/indexeddb/IDBValue.cpp: (WebCore::IDBValue::IDBValue): * Modules/indexeddb/IDBValue.h: * Modules/indexeddb/server/MemoryIndexCursor.cpp: (WebCore::IDBServer::MemoryIndexCursor::currentData): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::currentData): (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): * Modules/indexeddb/server/SQLiteIDBCursor.h: (WebCore::IDBServer::SQLiteIDBCursor::currentValue): (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer): Deleted. * Modules/indexeddb/server/SQLiteIDBTransaction.h: (WebCore::IDBServer::SQLiteIDBTransaction::backingStore): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::send): * bindings/js/IDBBindingUtilities.cpp: (WebCore::deserializeIDBValueDataToJSValue): (WebCore::deserializeIDBValueData): (WebCore::deserializeIDBValue): * bindings/js/IDBBindingUtilities.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readTerminal): (WebCore::CloneDeserializer::blobFilePathForBlobURL): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: * fileapi/Blob.cpp: (WebCore::Blob::Blob): * fileapi/Blob.h: (WebCore::Blob::deserialize): * fileapi/File.cpp: (WebCore::File::File): * fileapi/ThreadableBlobRegistry.cpp: (WebCore::threadableQueue): (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): * fileapi/ThreadableBlobRegistry.h: * platform/CrossThreadTask.h: (WebCore::createCrossThreadTask): * 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: Canonical link: https://commits.webkit.org/174668@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-14 00:54:10 +00:00
{
(object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))...);
Modern IDB (Blob support): Support retrieving Blobs from IDB. https://bugs.webkit.org/show_bug.cgi?id=156367 Reviewed by Alex Christensen. Source/WebCore: No new tests (No testable change in behavior yet, current tests pass). This patch does the following: - Pulls BlobURLs and stored filenames out of IDB whenever an IDB record is fetched. - Adds those URLs and filenames to IDBValue. - Uses IDBValue in more places instead of SharedBuffer/ThreadSafeBuffer. - Teaches SerializedScriptValue, Blob, and File how to read the URLs and filenames when they exist. - Teaches the Blob registry to register a new type of Blob that is not a "File" but is backed by one. * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::setGetResult): * Modules/indexeddb/IDBGetResult.h: (WebCore::IDBGetResult::IDBGetResult): * Modules/indexeddb/IDBRequest.cpp: (WebCore::IDBRequest::setResultToStructuredClone): * Modules/indexeddb/IDBRequest.h: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::didGetRecordOnServer): * Modules/indexeddb/IDBValue.cpp: (WebCore::IDBValue::IDBValue): * Modules/indexeddb/IDBValue.h: * Modules/indexeddb/server/MemoryIndexCursor.cpp: (WebCore::IDBServer::MemoryIndexCursor::currentData): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::currentData): (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): * Modules/indexeddb/server/SQLiteIDBCursor.h: (WebCore::IDBServer::SQLiteIDBCursor::currentValue): (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer): Deleted. * Modules/indexeddb/server/SQLiteIDBTransaction.h: (WebCore::IDBServer::SQLiteIDBTransaction::backingStore): * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: (WebCore::WorkerThreadableWebSocketChannel::Bridge::send): * bindings/js/IDBBindingUtilities.cpp: (WebCore::deserializeIDBValueDataToJSValue): (WebCore::deserializeIDBValueData): (WebCore::deserializeIDBValue): * bindings/js/IDBBindingUtilities.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::CloneDeserializer::readFile): (WebCore::CloneDeserializer::readTerminal): (WebCore::CloneDeserializer::blobFilePathForBlobURL): (WebCore::SerializedScriptValue::deserialize): * bindings/js/SerializedScriptValue.h: * fileapi/Blob.cpp: (WebCore::Blob::Blob): * fileapi/Blob.h: (WebCore::Blob::deserialize): * fileapi/File.cpp: (WebCore::File::File): * fileapi/ThreadableBlobRegistry.cpp: (WebCore::threadableQueue): (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): * fileapi/ThreadableBlobRegistry.h: * platform/CrossThreadTask.h: (WebCore::createCrossThreadTask): * 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: Canonical link: https://commits.webkit.org/174668@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-14 00:54:10 +00:00
}
template <typename C, typename MF, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
void callMemberFunctionForCrossThreadTask(C* object, MF function, ArgsTuple&& args)
IDB: "Put" support <rdar://problem/15779643> and https://bugs.webkit.org/show_bug.cgi?id=127401 Reviewed by Alexey Proskuryakov. Source/WebCore: Add persistent encode/decode for storage to the database: * Modules/indexeddb/IDBKey.cpp: (WebCore::IDBKey::encode): (WebCore::IDBKey::decode): * Modules/indexeddb/IDBKey.h: Add a data class to represent IDBKey suitable for crossing IPC: * Modules/indexeddb/IDBKeyData.cpp: Added. (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::maybeCreateIDBKey): (WebCore::IDBKeyData::isolatedCopy): * Modules/indexeddb/IDBKeyData.h: Added. (WebCore::IDBKeyData::IDBKeyData): * platform/CrossThreadCopier.cpp: (WebCore::IDBKeyData>::copy): * platform/CrossThreadCopier.h: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: Source/WebKit2: Ship putRecord requests over to the DatabaseProcess, and listen for completion from the DatabaseProcess: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::put): (WebKit::WebIDBServerConnection::didPutRecord): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Pass off the putRecord request to the Unique IDBDatabase: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::putRecord): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Pass off the putRecord request to the backing store: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::putRecord): (WebKit::UniqueIDBDatabase::putRecordInBackingStore): (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add backing store methods related to putRecord, though only one is critical right now: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKey): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGenerator): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add the IDBKeyData type to IPC: * Scripts/webkit2/messages.py: (struct_or_class): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<IDBKeyData>::encode): (IPC::ArgumentCoder<IDBKeyData>::decode): * Shared/WebCoreArgumentCoders.h: * DatabaseProcess/IndexedDB/IDBSerialization.cpp: (WebKit::serializeIDBKey): * DatabaseProcess/IndexedDB/IDBSerialization.h: Implement more cross-thread copying: * Shared/WebCrossThreadCopier.cpp: (WebCore::Vector<uint8_t>>::copy): (WebCore::Vector<Vector<IDBKeyData>>>::copy): (WebCore::ASCIILiteral>::copy): * Shared/WebCrossThreadCopier.h: Implement more numbers of generic AsyncTask templates: * Shared/AsyncTask.h: (WebKit::createAsyncTask): Canonical link: https://commits.webkit.org/145458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-22 23:48:27 +00:00
{
callMemberFunctionForCrossThreadTaskImpl(object, function, std::forward<ArgsTuple>(args), ArgsIndicies());
IDB: openCursor() needs to prime the cursor with first position values https://bugs.webkit.org/show_bug.cgi?id=128008 Reviewed by Alexey Proskuryakov. Source/WebCore: * Modules/indexeddb/IDBTransactionBackendOperations.cpp: (WebCore::OpenCursorOperation::perform): If the server connection returns initial keys/values for the cursor, store them. * Modules/indexeddb/IDBServerConnection.h: * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.cpp: (WebCore::IDBServerConnectionLevelDB::openCursor): * Modules/indexeddb/leveldb/IDBServerConnectionLevelDB.h: Source/WebKit2: Change openCursor() messaging to pass back the initial keys/values * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::didOpenCursor): (WebKit::WebIDBServerConnection::openCursor): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::openCursor): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::openCursor): (WebKit::UniqueIDBDatabase::cursorAdvance): Const and reference updates. (WebKit::UniqueIDBDatabase::cursorIterate): Ditto. (WebKit::UniqueIDBDatabase::openCursorInBackingStore): (WebKit::UniqueIDBDatabase::didOpenCursorInBackingStore): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openCursor): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp: (WebKit::SQLiteIDBCursor::maybeCreate): After creating the cursor, advance(1) it. * Shared/AsyncTask.h: (WebKit::createAsyncTask): Canonical link: https://commits.webkit.org/146008@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-31 20:50:57 +00:00
}
template<typename T, typename std::enable_if<std::is_base_of<ThreadSafeRefCountedBase, T>::value, int>::type = 0, typename... Parameters, typename... Arguments>
CrossThreadTask createCrossThreadTask(T& callee, void (T::*method)(Parameters...), const Arguments&... arguments)
{
return CrossThreadTask([callee = makeRefPtr(&callee), method, arguments = std::make_tuple(crossThreadCopy(arguments)...)]() mutable {
callMemberFunctionForCrossThreadTask(callee.get(), method, WTFMove(arguments));
});
}
template<typename T, typename std::enable_if<!std::is_base_of<ThreadSafeRefCountedBase, T>::value, int>::type = 0, typename... Parameters, typename... Arguments>
CrossThreadTask createCrossThreadTask(T& callee, void (T::*method)(Parameters...), const Arguments&... arguments)
IDB: "Put" support <rdar://problem/15779643> and https://bugs.webkit.org/show_bug.cgi?id=127401 Reviewed by Alexey Proskuryakov. Source/WebCore: Add persistent encode/decode for storage to the database: * Modules/indexeddb/IDBKey.cpp: (WebCore::IDBKey::encode): (WebCore::IDBKey::decode): * Modules/indexeddb/IDBKey.h: Add a data class to represent IDBKey suitable for crossing IPC: * Modules/indexeddb/IDBKeyData.cpp: Added. (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::maybeCreateIDBKey): (WebCore::IDBKeyData::isolatedCopy): * Modules/indexeddb/IDBKeyData.h: Added. (WebCore::IDBKeyData::IDBKeyData): * platform/CrossThreadCopier.cpp: (WebCore::IDBKeyData>::copy): * platform/CrossThreadCopier.h: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: Source/WebKit2: Ship putRecord requests over to the DatabaseProcess, and listen for completion from the DatabaseProcess: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::put): (WebKit::WebIDBServerConnection::didPutRecord): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Pass off the putRecord request to the Unique IDBDatabase: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::putRecord): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Pass off the putRecord request to the backing store: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::putRecord): (WebKit::UniqueIDBDatabase::putRecordInBackingStore): (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add backing store methods related to putRecord, though only one is critical right now: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKey): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGenerator): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add the IDBKeyData type to IPC: * Scripts/webkit2/messages.py: (struct_or_class): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<IDBKeyData>::encode): (IPC::ArgumentCoder<IDBKeyData>::decode): * Shared/WebCoreArgumentCoders.h: * DatabaseProcess/IndexedDB/IDBSerialization.cpp: (WebKit::serializeIDBKey): * DatabaseProcess/IndexedDB/IDBSerialization.h: Implement more cross-thread copying: * Shared/WebCrossThreadCopier.cpp: (WebCore::Vector<uint8_t>>::copy): (WebCore::Vector<Vector<IDBKeyData>>>::copy): (WebCore::ASCIILiteral>::copy): * Shared/WebCrossThreadCopier.h: Implement more numbers of generic AsyncTask templates: * Shared/AsyncTask.h: (WebKit::createAsyncTask): Canonical link: https://commits.webkit.org/145458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-22 23:48:27 +00:00
{
return CrossThreadTask([callee = &callee, method, arguments = std::make_tuple(crossThreadCopy(arguments)...)]() mutable {
callMemberFunctionForCrossThreadTask(callee, method, WTFMove(arguments));
});
IDB: "Put" support <rdar://problem/15779643> and https://bugs.webkit.org/show_bug.cgi?id=127401 Reviewed by Alexey Proskuryakov. Source/WebCore: Add persistent encode/decode for storage to the database: * Modules/indexeddb/IDBKey.cpp: (WebCore::IDBKey::encode): (WebCore::IDBKey::decode): * Modules/indexeddb/IDBKey.h: Add a data class to represent IDBKey suitable for crossing IPC: * Modules/indexeddb/IDBKeyData.cpp: Added. (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::maybeCreateIDBKey): (WebCore::IDBKeyData::isolatedCopy): * Modules/indexeddb/IDBKeyData.h: Added. (WebCore::IDBKeyData::IDBKeyData): * platform/CrossThreadCopier.cpp: (WebCore::IDBKeyData>::copy): * platform/CrossThreadCopier.h: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: Source/WebKit2: Ship putRecord requests over to the DatabaseProcess, and listen for completion from the DatabaseProcess: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: (WebKit::WebIDBServerConnection::put): (WebKit::WebIDBServerConnection::didPutRecord): * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h: * WebProcess/Databases/IndexedDB/WebIDBServerConnection.messages.in: Pass off the putRecord request to the Unique IDBDatabase: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::putRecord): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h: * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in: Pass off the putRecord request to the backing store: * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::putRecord): (WebKit::UniqueIDBDatabase::putRecordInBackingStore): (WebKit::UniqueIDBDatabase::didPutRecordInBackingStore): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add backing store methods related to putRecord, though only one is critical right now: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKey): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGenerator): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add the IDBKeyData type to IPC: * Scripts/webkit2/messages.py: (struct_or_class): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<IDBKeyData>::encode): (IPC::ArgumentCoder<IDBKeyData>::decode): * Shared/WebCoreArgumentCoders.h: * DatabaseProcess/IndexedDB/IDBSerialization.cpp: (WebKit::serializeIDBKey): * DatabaseProcess/IndexedDB/IDBSerialization.h: Implement more cross-thread copying: * Shared/WebCrossThreadCopier.cpp: (WebCore::Vector<uint8_t>>::copy): (WebCore::Vector<Vector<IDBKeyData>>>::copy): (WebCore::ASCIILiteral>::copy): * Shared/WebCrossThreadCopier.h: Implement more numbers of generic AsyncTask templates: * Shared/AsyncTask.h: (WebKit::createAsyncTask): Canonical link: https://commits.webkit.org/145458@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162566 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-01-22 23:48:27 +00:00
}
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
} // namespace WTF
DatabaseProcess IndexedDB: Establish a metadata backing store on disk https://bugs.webkit.org/show_bug.cgi?id=125258 Reviewed by Alexey Proskuryakov, Anders Carlsson, and Tim Horton. Source/WebCore: Teach CrossThreadCopier how to handle IDBDatabaseMetadata. * CMakeLists.txt: * GNUmakefile.list.am: * WebCore.exp.in: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBDatabaseMetadata.cpp: Added. (WebCore::IDBDatabaseMetadata::isolatedCopy): (WebCore::IDBObjectStoreMetadata::isolatedCopy): (WebCore::IDBIndexMetadata::isolatedCopy): * Modules/indexeddb/IDBDatabaseMetadata.h: * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::IDBKeyPath::isolatedCopy): * Modules/indexeddb/IDBKeyPath.h: * platform/CrossThreadCopier.cpp: (WebCore::::copy): Add an IDBDatabaseMetadata specialization. * platform/CrossThreadCopier.h: Source/WebKit2: The DatabaseProcess already has an "Indexed Database path". Each SecurityOrigin with indexed databases will have a subdirectory under the path. Each indexed database will have a subdirectory under its SecurityOrigin's path. Inside that directory will exist (1) metadata database, and 0-N ObjectStore databases. This patch establishes the directory structure and the (1) metadata database. * DatabaseProcess/DatabaseProcess.cpp: (WebKit::DatabaseProcess::initializeDatabaseProcess): Asynchronously ensure the indexed database directory exists. (WebKit::DatabaseProcess::ensureIndexedDatabaseRelativePathExists): Allow anyone to make necessary directories relative to the indexed database directory. (WebKit::DatabaseProcess::ensurePathExists): (WebKit::DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath): Instead of exposing the indexed database directory, give DatabaseProcess a method to allow others to compute a path relative to the indexed database directory. (WebKit::DatabaseProcess::postDatabaseTask): (WebKit::DatabaseProcess::performNextDatabaseTask): * DatabaseProcess/DatabaseProcess.h: (WebKit::DatabaseProcess::queue): * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp: (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp: (WebKit::UniqueIDBDatabase::UniqueIDBDatabase): (WebKit::UniqueIDBDatabase::filenameForDatabaseName): (WebKit::UniqueIDBDatabase::databaseFilenameIdentifier): (WebKit::UniqueIDBDatabase::canShareDatabases): (WebKit::UniqueIDBDatabase::shutdown): Method to cleanly shutdown a database, emptying its task and request queues. (WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): (WebKit::UniqueIDBDatabase::openBackingStoreAndReadMetadata): To be run on the database work queue, establishes a backing store and extracts metadata from it. (WebKit::UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata): Callback once metadata from the backing store is ready for use. (WebKit::UniqueIDBDatabase::absoluteDatabaseDirectory): (WebKit::UniqueIDBDatabase::postMainThreadTask): Add a main thread task for this database. (WebKit::UniqueIDBDatabase::performNextMainThreadTask): (WebKit::UniqueIDBDatabase::postDatabaseTask): Add a database queue task for this database. (WebKit::UniqueIDBDatabase::performNextDatabaseTask): * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h: Add a virtual backing store interface: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h: (WebKit::UniqueIDBDatabaseBackingStore::~UniqueIDBDatabaseBackingStore): Add a SQLite implementation of that interface: * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp: Added. (WebKit::UniqueIDBDatabaseBackingStoreSQLite::UniqueIDBDatabaseBackingStoreSQLite): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::openSQLiteDatabaseAtPath): (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getOrEstablishMetadata): * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h: Add a general purpose asynchronous task that does cross thread copying: * Shared/AsyncTask.h: Added. (WebKit::AsyncTask::~AsyncTask): (WebKit::AsyncTask::AsyncTask): (WebKit::createAsyncTask): Add more isolated copiers and introduce WebKit CrossThreadCopier specializations: * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.cpp: (WebKit::UniqueIDBDatabaseIdentifier::isolatedCopy): * DatabaseProcess/IndexedDB/UniqueIDBDatabaseIdentifier.h: * Shared/SecurityOriginData.cpp: (WebKit::SecurityOriginData::isolatedCopy): * Shared/SecurityOriginData.h: * Shared/WebCrossThreadCopier.cpp: (WebCore::::copy): * Shared/WebCrossThreadCopier.h: * WebKit2.xcodeproj/project.pbxproj: Source/WTF: * wtf/text/WTFString.h: Export toUInt64Strict(). Canonical link: https://commits.webkit.org/143691@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-13 00:42:14 +00:00
Move CrossThreadCopier/CrossThreadTask to WTF. https://bugs.webkit.org/show_bug.cgi?id=158207 Reviewed by Alex Christensen. Source/WebCore: No new tests (Refactor, no behavior change). * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * Modules/indexeddb/IDBActiveDOMObject.h: * Modules/indexeddb/IDBValue.cpp: * Modules/indexeddb/client/IDBConnectionProxy.h: * Modules/indexeddb/server/IDBServer.cpp: * Modules/indexeddb/server/IDBServer.h: * Modules/indexeddb/server/UniqueIDBDatabase.h: * dom/ScriptExecutionContext.h: * fileapi/ThreadableBlobRegistry.cpp: * platform/WebCoreCrossThreadCopier.cpp: Added. (WTF::WebCore::SessionID>::copy): (WTF::WebCore::ThreadSafeDataBuffer>::copy): * platform/WebCoreCrossThreadCopier.h: Added. * platform/network/cf/ResourceError.h: (WebCore::ResourceError::isolatedCopy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::isolatedCopy): * platform/network/cf/ResourceResponse.h: (WebCore::ResourceResponse::isolatedCopy): Source/WebKit2: * CMakeLists.txt: * WebKit2.xcodeproj/project.pbxproj: * DatabaseProcess/DatabaseProcess.cpp: * DatabaseProcess/DatabaseProcess.h: * Shared/WebCrossThreadCopier.cpp: Removed. * Shared/WebCrossThreadCopier.h: Removed. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/CrossThreadCopier.cpp: Renamed from Source/WebCore/platform/CrossThreadCopier.cpp. * wtf/CrossThreadCopier.h: Renamed from Source/WebCore/platform/CrossThreadCopier.h. (WTF::CrossThreadCopierPassThrough::copy): * wtf/CrossThreadTask.h: Renamed from Source/WebCore/platform/CrossThreadTask.h. (WTF::CrossThreadTask::CrossThreadTask): (WTF::CrossThreadTask::performTask): (WTF::createCrossThreadTask): Canonical link: https://commits.webkit.org/176304@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-31 03:35:44 +00:00
using WTF::CrossThreadTask;
using WTF::createCrossThreadTask;