Move WebKit2 AsyncTask to WebCore CrossThreadTask.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Sep 2015 23:28:22 +0000 (23:28 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Sep 2015 23:28:22 +0000 (23:28 +0000)
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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/CrossThreadTask.h [moved from Source/WebKit2/Shared/AsyncTask.h with 80% similarity]
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp
Source/WebKit2/DatabaseProcess/DatabaseProcess.h
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index 52d47d3..96cfbe3 100644 (file)
@@ -1,3 +1,20 @@
+2015-09-29  Brady Eidson  <beidson@apple.com>
+
+        Move WebKit2 AsyncTask to WebCore CrossThreadTask.
+        https://bugs.webkit.org/show_bug.cgi?id=149651
+
+        Reviewed by Alex Christensen.
+
+        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):
+
 2015-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Snap offsets should update when style is programmatically changed
index ca028ba..6055ccf 100644 (file)
                51E3F9D60DA05E1D00250911 /* JSStorage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51E3F9D40DA05E1D00250911 /* JSStorage.cpp */; };
                51E4143416A6596300C633C7 /* ResourceHandleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4143216A6595100C633C7 /* ResourceHandleTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6820F16387302003BBF3C /* LoaderStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               51E6FA7C1BBB4FC3008700D9 /* CrossThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51EC92650CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */; };
                51EE7B381AA50B0500F92B21 /* ResourceLoadInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
                51EE7B3A1AA5123100F92B21 /* ResourceLoadInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EE7B391AA5123100F92B21 /* ResourceLoadInfo.cpp */; };
                51E3F9D50DA05E1D00250911 /* JSStorage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStorage.h; sourceTree = "<group>"; };
                51E4143216A6595100C633C7 /* ResourceHandleTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceHandleTypes.h; sourceTree = "<group>"; };
                51E6820F16387302003BBF3C /* LoaderStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoaderStrategy.h; sourceTree = "<group>"; };
+               51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadTask.h; sourceTree = "<group>"; };
                51EAC5B018163F4E004F1BA4 /* IDBRecordIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBRecordIdentifier.h; sourceTree = "<group>"; };
                51EC925D0CE90DD400F90308 /* JSCustomSQLStatementErrorCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomSQLStatementErrorCallback.cpp; sourceTree = "<group>"; };
                51EE7B371AA50B0500F92B21 /* ResourceLoadInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadInfo.h; sourceTree = "<group>"; };
                                862F129D18C1572C005C54AF /* CountedUserActivity.h */,
                                2E4346560F546A9900B0F1BA /* CrossThreadCopier.cpp */,
                                2E4346570F546A9900B0F1BA /* CrossThreadCopier.h */,
+                               51E6FA7B1BBB4FB5008700D9 /* CrossThreadTask.h */,
                                E11AF15011B9A1A300805103 /* Cursor.cpp */,
                                F587868402DE3B8601EA4122 /* Cursor.h */,
                                A5732B08136A161D005C8D7C /* DateComponents.cpp */,
                                07367DDF172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h in Headers */,
                                BE16C59517CFE17200852C04 /* InbandWebVTTTextTrack.h in Headers */,
                                DB23C2CC0A508D29002489EB /* IndentOutdentCommand.h in Headers */,
+                               51E6FA7C1BBB4FC3008700D9 /* CrossThreadTask.h in Headers */,
                                A8CFF5E50A155A05000A4234 /* InlineBox.h in Headers */,
                                B57CB52E182A3EFC0079A647 /* InlineElementBox.h in Headers */,
                                A8CFF5E30A155A05000A4234 /* InlineFlowBox.h in Headers */,
similarity index 80%
rename from Source/WebKit2/Shared/AsyncTask.h
rename to Source/WebCore/platform/CrossThreadTask.h
index 36d853c..ed40f56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef AsyncTask_h
-#define AsyncTask_h
+#ifndef CrossThreadTask_h
+#define CrossThreadTask_h
 
-#include <WebCore/CrossThreadCopier.h>
+#include "CrossThreadCopier.h"
 #include <functional>
 
 namespace WebKit {
 
-class AsyncTask {
-    WTF_MAKE_NONCOPYABLE(AsyncTask);
+class CrossThreadTask {
+    WTF_MAKE_NONCOPYABLE(CrossThreadTask);
 public:
-    AsyncTask(const std::function<void ()> taskFunction)
+    CrossThreadTask(const std::function<void ()> taskFunction)
         : m_taskFunction(taskFunction)
     {
         ASSERT(taskFunction);
@@ -46,15 +46,15 @@ public:
     }
 
 protected:
-    AsyncTask() { }
+    CrossThreadTask() { }
 
     std::function<void ()> m_taskFunction;
 };
 
 template <typename T, typename... Arguments>
-class AsyncTaskImpl final : public AsyncTask {
+class CrossThreadTaskImpl final : public CrossThreadTask {
 public:
-    AsyncTaskImpl(T* callee, void (T::*method)(Arguments...), Arguments&&... arguments)
+    CrossThreadTaskImpl(T* callee, void (T::*method)(Arguments...), Arguments&&... arguments)
     {
         m_taskFunction = [callee, method, arguments...] {
             (callee->*method)(arguments...);
@@ -63,33 +63,33 @@ public:
 };
 
 template<typename T>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)())
 {
-    return std::make_unique<AsyncTaskImpl<T>>(&callee, method);
+    return std::make_unique<CrossThreadTaskImpl<T>>(&callee, method);
 }
 
 template<typename T, typename P1, typename MP1>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1),
     const P1& parameter1)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1));
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2),
     const P1& parameter1,
     const P2& parameter2)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -98,14 +98,14 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3),
     const P1& parameter1,
     const P2& parameter2,
     const P3& parameter3)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -114,7 +114,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3, MP4),
     const P1& parameter1,
@@ -122,7 +122,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
     const P3& parameter3,
     const P4& parameter4)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3, MP4>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -132,7 +132,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3, MP4, MP5),
     const P1& parameter1,
@@ -141,7 +141,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
     const P4& parameter4,
     const P5& parameter5)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3, MP4, MP5>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -152,7 +152,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6),
     const P1& parameter1,
@@ -162,7 +162,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
     const P5& parameter5,
     const P6& parameter6)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -174,7 +174,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7),
     const P1& parameter1,
@@ -185,7 +185,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
     const P6& parameter6,
     const P7& parameter7)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -198,7 +198,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 }
 
 template<typename T, typename P1, typename MP1, typename P2, typename MP2, typename P3, typename MP3, typename P4, typename MP4, typename P5, typename MP5, typename P6, typename MP6, typename P7, typename MP7, typename P8, typename MP8>
-std::unique_ptr<AsyncTask> createAsyncTask(
+std::unique_ptr<CrossThreadTask> createCrossThreadTask(
     T& callee,
     void (T::*method)(MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8),
     const P1& parameter1,
@@ -210,7 +210,7 @@ std::unique_ptr<AsyncTask> createAsyncTask(
     const P7& parameter7,
     const P8& parameter8)
 {
-    return std::make_unique<AsyncTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8>>(
+    return std::make_unique<CrossThreadTaskImpl<T, MP1, MP2, MP3, MP4, MP5, MP6, MP7, MP8>>(
         &callee,
         method,
         WebCore::CrossThreadCopier<P1>::copy(parameter1),
@@ -225,4 +225,4 @@ std::unique_ptr<AsyncTask> createAsyncTask(
 
 } // namespace WebKit
 
-#endif // AsyncTask_h
+#endif // CrossThreadTask_h
index 08875f0..b03833f 100644 (file)
@@ -1,3 +1,67 @@
+2015-09-29  Brady Eidson  <beidson@apple.com>
+
+        Move WebKit2 AsyncTask to WebCore CrossThreadTask.
+        https://bugs.webkit.org/show_bug.cgi?id=149651
+
+        Reviewed by Alex Christensen.
+
+        * 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:
+
 2015-09-29  Chris Dumez  <cdumez@apple.com>
 
         Memory cache revalidations should refresh the network disk cache
index c8d8a3c..411ffb4 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(DATABASE_PROCESS)
 
-#include "AsyncTask.h"
 #include "DatabaseProcessCreationParameters.h"
 #include "DatabaseProcessMessages.h"
 #include "DatabaseProcessProxyMessages.h"
@@ -36,6 +35,7 @@
 #include "UniqueIDBDatabase.h"
 #include "WebCrossThreadCopier.h"
 #include "WebsiteData.h"
+#include <WebCore/CrossThreadTask.h>
 #include <WebCore/FileSystem.h>
 #include <WebCore/NotImplemented.h>
 #include <WebCore/SessionID.h>
@@ -134,7 +134,7 @@ void DatabaseProcess::initializeDatabaseProcess(const DatabaseProcessCreationPar
 #if ENABLE(INDEXED_DATABASE)
 void DatabaseProcess::ensureIndexedDatabaseRelativePathExists(const String& relativePath)
 {
-    postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::ensurePathExists, absoluteIndexedDatabasePathFromDatabaseRelativePath(relativePath)));
+    postDatabaseTask(createCrossThreadTask(*this, &DatabaseProcess::ensurePathExists, absoluteIndexedDatabasePathFromDatabaseRelativePath(relativePath)));
 }
 #endif
 
@@ -155,7 +155,7 @@ String DatabaseProcess::absoluteIndexedDatabasePathFromDatabaseRelativePath(cons
 }
 #endif
 
-void DatabaseProcess::postDatabaseTask(std::unique_ptr<AsyncTask> task)
+void DatabaseProcess::postDatabaseTask(std::unique_ptr<CrossThreadTask> task)
 {
     ASSERT(RunLoop::isMain());
 
@@ -172,7 +172,7 @@ void DatabaseProcess::performNextDatabaseTask()
 {
     ASSERT(!RunLoop::isMain());
 
-    std::unique_ptr<AsyncTask> task;
+    std::unique_ptr<CrossThreadTask> task;
     {
         LockHolder locker(m_databaseTaskMutex);
         ASSERT(!m_databaseTasks.isEmpty());
@@ -235,7 +235,7 @@ void DatabaseProcess::fetchWebsiteData(SessionID, uint64_t websiteDataTypes, uin
 #if ENABLE(INDEXED_DATABASE)
     if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) {
         // FIXME: Pick the right database store based on the session ID.
-        postDatabaseTask(std::make_unique<AsyncTask>([callbackAggregator, websiteDataTypes, this] {
+        postDatabaseTask(std::make_unique<CrossThreadTask>([callbackAggregator, websiteDataTypes, this] {
 
             Vector<RefPtr<SecurityOrigin>> securityOrigins = indexedDatabaseOrigins();
 
@@ -272,7 +272,7 @@ void DatabaseProcess::deleteWebsiteData(WebCore::SessionID, uint64_t websiteData
 
 #if ENABLE(INDEXED_DATABASE)
     if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) {
-        postDatabaseTask(std::make_unique<AsyncTask>([this, callbackAggregator, modifiedSince] {
+        postDatabaseTask(std::make_unique<CrossThreadTask>([this, callbackAggregator, modifiedSince] {
 
             deleteIndexedDatabaseEntriesModifiedSince(modifiedSince);
             RunLoop::main().dispatch([callbackAggregator] { });
@@ -309,7 +309,7 @@ void DatabaseProcess::deleteWebsiteDataForOrigins(WebCore::SessionID, uint64_t w
         for (const auto& securityOriginData : securityOriginDatas)
             securityOrigins.append(securityOriginData.securityOrigin());
 
-        postDatabaseTask(std::make_unique<AsyncTask>([this, securityOrigins, callbackAggregator] {
+        postDatabaseTask(std::make_unique<CrossThreadTask>([this, securityOrigins, callbackAggregator] {
             deleteIndexedDatabaseEntriesForOrigins(securityOrigins);
 
             RunLoop::main().dispatch([callbackAggregator] { });
index 3f0a150..ec47794 100644 (file)
@@ -39,7 +39,7 @@ struct SecurityOriginData;
 
 namespace WebKit {
 
-class AsyncTask;
+class CrossThreadTask;
 class DatabaseToWebProcessConnection;
 class UniqueIDBDatabase;
 
@@ -64,7 +64,7 @@ public:
 
     WorkQueue& queue() { return m_queue.get(); }
 
-    void postDatabaseTask(std::unique_ptr<AsyncTask>);
+    void postDatabaseTask(std::unique_ptr<CrossThreadTask>);
 
 private:
     DatabaseProcess();
@@ -112,7 +112,7 @@ private:
     HashMap<UniqueIDBDatabaseIdentifier, RefPtr<UniqueIDBDatabase>> m_idbDatabases;
 #endif
 
-    Deque<std::unique_ptr<AsyncTask>> m_databaseTasks;
+    Deque<std::unique_ptr<CrossThreadTask>> m_databaseTasks;
     Lock m_databaseTaskMutex;
 };
 
index 56dd86e..ba0a874 100644 (file)
 #if ENABLE(INDEXED_DATABASE) && ENABLE(DATABASE_PROCESS)
 
 #include "AsyncRequest.h"
-#include "AsyncTask.h"
 #include "DataReference.h"
 #include "DatabaseProcess.h"
 #include "DatabaseProcessIDBConnection.h"
 #include "Logging.h"
 #include "UniqueIDBDatabaseBackingStoreSQLite.h"
 #include "WebCrossThreadCopier.h"
+#include <WebCore/CrossThreadTask.h>
 #include <WebCore/FileSystem.h>
 #include <WebCore/IDBDatabaseMetadata.h>
 #include <WebCore/IDBGetResult.h>
@@ -140,7 +140,7 @@ void UniqueIDBDatabase::shutdown(UniqueIDBDatabaseShutdownType type)
         m_databaseTasks.clear();
     }
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::shutdownBackingStore, type, absoluteDatabaseDirectory()), DatabaseTaskType::Shutdown);
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::shutdownBackingStore, type, absoluteDatabaseDirectory()), DatabaseTaskType::Shutdown);
 }
 
 void UniqueIDBDatabase::shutdownBackingStore(UniqueIDBDatabaseShutdownType type, const String& databaseDirectory)
@@ -156,7 +156,7 @@ void UniqueIDBDatabase::shutdownBackingStore(UniqueIDBDatabaseShutdownType type,
         deleteEmptyDirectory(databaseDirectory);
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didShutdownBackingStore, type), DatabaseTaskType::Shutdown);
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didShutdownBackingStore, type), DatabaseTaskType::Shutdown);
 }
 
 void UniqueIDBDatabase::didShutdownBackingStore(UniqueIDBDatabaseShutdownType type)
@@ -248,7 +248,7 @@ void UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata(std::function<void (bo
     m_pendingMetadataRequests.append(request.release());
 
     if (shouldOpenBackingStore)
-        postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::openBackingStoreAndReadMetadata, m_identifier, absoluteDatabaseDirectory()));
+        postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStoreAndReadMetadata, m_identifier, absoluteDatabaseDirectory()));
 }
 
 void UniqueIDBDatabase::openBackingStoreAndReadMetadata(const UniqueIDBDatabaseIdentifier& identifier, const String& databaseDirectory)
@@ -264,7 +264,7 @@ void UniqueIDBDatabase::openBackingStoreAndReadMetadata(const UniqueIDBDatabaseI
     m_backingStore = UniqueIDBDatabaseBackingStoreSQLite::create(identifier, databaseDirectory);
     std::unique_ptr<IDBDatabaseMetadata> metadata = m_backingStore->getOrEstablishMetadata();
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata, metadata ? *metadata : IDBDatabaseMetadata(), !!metadata));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata, metadata ? *metadata : IDBDatabaseMetadata(), !!metadata));
 }
 
 void UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata(const IDBDatabaseMetadata& metadata, bool success)
@@ -285,30 +285,30 @@ void UniqueIDBDatabase::didOpenBackingStoreAndReadMetadata(const IDBDatabaseMeta
 
 void UniqueIDBDatabase::openTransaction(const IDBIdentifier& transactionIdentifier, const Vector<int64_t>& objectStoreIDs, IndexedDB::TransactionMode mode, std::function<void (bool)> successCallback)
 {
-    postTransactionOperation(transactionIdentifier, createAsyncTask(*this, &UniqueIDBDatabase::openBackingStoreTransaction, transactionIdentifier, objectStoreIDs, mode), successCallback);
+    postTransactionOperation(transactionIdentifier, createCrossThreadTask(*this, &UniqueIDBDatabase::openBackingStoreTransaction, transactionIdentifier, objectStoreIDs, mode), successCallback);
 }
 
 void UniqueIDBDatabase::beginTransaction(const IDBIdentifier& transactionIdentifier, std::function<void (bool)> successCallback)
 {
-    postTransactionOperation(transactionIdentifier, createAsyncTask(*this, &UniqueIDBDatabase::beginBackingStoreTransaction, transactionIdentifier), successCallback);
+    postTransactionOperation(transactionIdentifier, createCrossThreadTask(*this, &UniqueIDBDatabase::beginBackingStoreTransaction, transactionIdentifier), successCallback);
 }
 
 void UniqueIDBDatabase::commitTransaction(const IDBIdentifier& transactionIdentifier, std::function<void (bool)> successCallback)
 {
-    postTransactionOperation(transactionIdentifier, createAsyncTask(*this, &UniqueIDBDatabase::commitBackingStoreTransaction, transactionIdentifier), successCallback);
+    postTransactionOperation(transactionIdentifier, createCrossThreadTask(*this, &UniqueIDBDatabase::commitBackingStoreTransaction, transactionIdentifier), successCallback);
 }
 
 void UniqueIDBDatabase::resetTransaction(const IDBIdentifier& transactionIdentifier, std::function<void (bool)> successCallback)
 {
-    postTransactionOperation(transactionIdentifier, createAsyncTask(*this, &UniqueIDBDatabase::resetBackingStoreTransaction, transactionIdentifier), successCallback);
+    postTransactionOperation(transactionIdentifier, createCrossThreadTask(*this, &UniqueIDBDatabase::resetBackingStoreTransaction, transactionIdentifier), successCallback);
 }
 
 void UniqueIDBDatabase::rollbackTransaction(const IDBIdentifier& transactionIdentifier, std::function<void (bool)> successCallback)
 {
-    postTransactionOperation(transactionIdentifier, createAsyncTask(*this, &UniqueIDBDatabase::rollbackBackingStoreTransaction, transactionIdentifier), successCallback);
+    postTransactionOperation(transactionIdentifier, createCrossThreadTask(*this, &UniqueIDBDatabase::rollbackBackingStoreTransaction, transactionIdentifier), successCallback);
 }
 
-void UniqueIDBDatabase::postTransactionOperation(const IDBIdentifier& transactionIdentifier, std::unique_ptr<AsyncTask> task, std::function<void (bool)> successCallback)
+void UniqueIDBDatabase::postTransactionOperation(const IDBIdentifier& transactionIdentifier, std::unique_ptr<CrossThreadTask> task, std::function<void (bool)> successCallback)
 {
     ASSERT(RunLoop::isMain());
 
@@ -371,7 +371,7 @@ void UniqueIDBDatabase::changeDatabaseVersion(const IDBIdentifier& transactionId
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::changeDatabaseVersionInBackingStore, requestID, transactionIdentifier, newVersion));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::changeDatabaseVersionInBackingStore, requestID, transactionIdentifier, newVersion));
 }
 
 void UniqueIDBDatabase::didChangeDatabaseVersion(uint64_t requestID, bool success)
@@ -434,7 +434,7 @@ void UniqueIDBDatabase::createObjectStore(const IDBIdentifier& transactionIdenti
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::createObjectStoreInBackingStore, requestID, transactionIdentifier, metadata));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::createObjectStoreInBackingStore, requestID, transactionIdentifier, metadata));
 }
 
 void UniqueIDBDatabase::deleteObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, std::function<void (bool)> successCallback)
@@ -461,7 +461,7 @@ void UniqueIDBDatabase::deleteObjectStore(const IDBIdentifier& transactionIdenti
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::deleteObjectStoreInBackingStore, requestID, transactionIdentifier, objectStoreID));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::deleteObjectStoreInBackingStore, requestID, transactionIdentifier, objectStoreID));
 }
 
 void UniqueIDBDatabase::clearObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, std::function<void (bool)> successCallback)
@@ -484,7 +484,7 @@ void UniqueIDBDatabase::clearObjectStore(const IDBIdentifier& transactionIdentif
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::clearObjectStoreInBackingStore, requestID, transactionIdentifier, objectStoreID));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::clearObjectStoreInBackingStore, requestID, transactionIdentifier, objectStoreID));
 }
 
 void UniqueIDBDatabase::createIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBIndexMetadata& metadata, std::function<void (bool)> successCallback)
@@ -518,7 +518,7 @@ void UniqueIDBDatabase::createIndex(const IDBIdentifier& transactionIdentifier,
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::createIndexInBackingStore, requestID, transactionIdentifier, objectStoreID, metadata));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::createIndexInBackingStore, requestID, transactionIdentifier, objectStoreID, metadata));
 }
 
 void UniqueIDBDatabase::deleteIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, std::function<void (bool)> successCallback)
@@ -552,7 +552,7 @@ void UniqueIDBDatabase::deleteIndex(const IDBIdentifier& transactionIdentifier,
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::deleteIndexInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::deleteIndexInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID));
 }
 
 void UniqueIDBDatabase::putRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBKeyData& keyData, const IPC::DataReference& value, int64_t putMode, const Vector<int64_t>& indexIDs, const Vector<Vector<IDBKeyData>>& indexKeys, std::function<void (const IDBKeyData&, uint32_t, const String&)> callback)
@@ -575,7 +575,7 @@ void UniqueIDBDatabase::putRecord(const IDBIdentifier& transactionIdentifier, in
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::putRecordInBackingStore, requestID, transactionIdentifier, m_metadata->objectStores.get(objectStoreID), keyData, value.vector(), putMode, indexIDs, indexKeys));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::putRecordInBackingStore, requestID, transactionIdentifier, m_metadata->objectStores.get(objectStoreID), keyData, value.vector(), putMode, indexIDs, indexKeys));
 }
 
 void UniqueIDBDatabase::getRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData& keyRangeData, IndexedDB::CursorType cursorType, std::function<void (const IDBGetResult&, uint32_t, const String&)> callback)
@@ -598,7 +598,7 @@ void UniqueIDBDatabase::getRecord(const IDBIdentifier& transactionIdentifier, in
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::getRecordFromBackingStore, requestID, transactionIdentifier, m_metadata->objectStores.get(objectStoreID), indexID, keyRangeData, cursorType));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::getRecordFromBackingStore, requestID, transactionIdentifier, m_metadata->objectStores.get(objectStoreID), indexID, keyRangeData, cursorType));
 }
 
 void UniqueIDBDatabase::openCursor(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, IndexedDB::CursorDirection cursorDirection, IndexedDB::CursorType cursorType, IDBDatabaseBackend::TaskType taskType, const IDBKeyRangeData& keyRangeData, std::function<void (int64_t, const IDBKeyData&, const IDBKeyData&, PassRefPtr<SharedBuffer>, uint32_t, const String&)> callback)
@@ -621,7 +621,7 @@ void UniqueIDBDatabase::openCursor(const IDBIdentifier& transactionIdentifier, i
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::openCursorInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID, cursorDirection, cursorType, taskType, keyRangeData));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::openCursorInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID, cursorDirection, cursorType, taskType, keyRangeData));
 }
 
 void UniqueIDBDatabase::cursorAdvance(const IDBIdentifier& cursorIdentifier, uint64_t count, std::function<void (const IDBKeyData&, const IDBKeyData&, PassRefPtr<SharedBuffer>, uint32_t, const String&)> callback)
@@ -642,7 +642,7 @@ void UniqueIDBDatabase::cursorAdvance(const IDBIdentifier& cursorIdentifier, uin
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::advanceCursorInBackingStore, requestID, cursorIdentifier, count));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::advanceCursorInBackingStore, requestID, cursorIdentifier, count));
 }
 
 void UniqueIDBDatabase::cursorIterate(const IDBIdentifier& cursorIdentifier, const IDBKeyData& key, std::function<void (const IDBKeyData&, const IDBKeyData&, PassRefPtr<SharedBuffer>, uint32_t, const String&)> callback)
@@ -663,7 +663,7 @@ void UniqueIDBDatabase::cursorIterate(const IDBIdentifier& cursorIdentifier, con
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::iterateCursorInBackingStore, requestID, cursorIdentifier, key));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::iterateCursorInBackingStore, requestID, cursorIdentifier, key));
 }
 
 void UniqueIDBDatabase::count(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID, const IDBKeyRangeData& keyRangeData, std::function<void (int64_t, uint32_t, const String&)> callback)
@@ -684,7 +684,7 @@ void UniqueIDBDatabase::count(const IDBIdentifier& transactionIdentifier, int64_
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::countInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID, keyRangeData));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::countInBackingStore, requestID, transactionIdentifier, objectStoreID, indexID, keyRangeData));
 }
 
 void UniqueIDBDatabase::deleteRange(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBKeyRangeData& keyRangeData, std::function<void (uint32_t, const String&)> callback)
@@ -705,7 +705,7 @@ void UniqueIDBDatabase::deleteRange(const IDBIdentifier& transactionIdentifier,
     uint64_t requestID = request->requestID();
     m_pendingDatabaseTasks.add(requestID, request.release());
 
-    postDatabaseTask(createAsyncTask(*this, &UniqueIDBDatabase::deleteRangeInBackingStore, requestID, transactionIdentifier, objectStoreID, keyRangeData));
+    postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::deleteRangeInBackingStore, requestID, transactionIdentifier, objectStoreID, keyRangeData));
 }
 
 void UniqueIDBDatabase::openBackingStoreTransaction(const IDBIdentifier& transactionIdentifier, const Vector<int64_t>& objectStoreIDs, IndexedDB::TransactionMode mode)
@@ -715,8 +715,8 @@ void UniqueIDBDatabase::openBackingStoreTransaction(const IDBIdentifier& transac
 
     bool success = m_backingStore->establishTransaction(transactionIdentifier, objectStoreIDs, mode);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didEstablishTransaction, transactionIdentifier, success));
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didEstablishTransaction, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
 }
 
 void UniqueIDBDatabase::beginBackingStoreTransaction(const IDBIdentifier& transactionIdentifier)
@@ -726,7 +726,7 @@ void UniqueIDBDatabase::beginBackingStoreTransaction(const IDBIdentifier& transa
 
     bool success = m_backingStore->beginTransaction(transactionIdentifier);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
 }
 
 void UniqueIDBDatabase::commitBackingStoreTransaction(const IDBIdentifier& transactionIdentifier)
@@ -736,7 +736,7 @@ void UniqueIDBDatabase::commitBackingStoreTransaction(const IDBIdentifier& trans
 
     bool success = m_backingStore->commitTransaction(transactionIdentifier);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
 }
 
 void UniqueIDBDatabase::resetBackingStoreTransaction(const IDBIdentifier& transactionIdentifier)
@@ -746,8 +746,8 @@ void UniqueIDBDatabase::resetBackingStoreTransaction(const IDBIdentifier& transa
 
     bool success = m_backingStore->resetTransaction(transactionIdentifier);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didResetTransaction, transactionIdentifier, success));
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didResetTransaction, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
 }
 
 void UniqueIDBDatabase::rollbackBackingStoreTransaction(const IDBIdentifier& transactionIdentifier)
@@ -757,7 +757,7 @@ void UniqueIDBDatabase::rollbackBackingStoreTransaction(const IDBIdentifier& tra
 
     bool success = m_backingStore->rollbackTransaction(transactionIdentifier);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCompleteTransactionOperation, transactionIdentifier, success));
 }
 
 void UniqueIDBDatabase::changeDatabaseVersionInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, uint64_t newVersion)
@@ -767,7 +767,7 @@ void UniqueIDBDatabase::changeDatabaseVersionInBackingStore(uint64_t requestID,
 
     bool success = m_backingStore->changeDatabaseVersion(transactionIdentifier, newVersion);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didChangeDatabaseVersion, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didChangeDatabaseVersion, requestID, success));
 }
 
 void UniqueIDBDatabase::createObjectStoreInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, const IDBObjectStoreMetadata& metadata)
@@ -777,7 +777,7 @@ void UniqueIDBDatabase::createObjectStoreInBackingStore(uint64_t requestID, cons
 
     bool success = m_backingStore->createObjectStore(transactionIdentifier, metadata);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCreateObjectStore, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCreateObjectStore, requestID, success));
 }
 
 void UniqueIDBDatabase::deleteObjectStoreInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, int64_t objectStoreID)
@@ -787,7 +787,7 @@ void UniqueIDBDatabase::deleteObjectStoreInBackingStore(uint64_t requestID, cons
 
     bool success = m_backingStore->deleteObjectStore(transactionIdentifier, objectStoreID);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didDeleteObjectStore, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didDeleteObjectStore, requestID, success));
 }
 
 void UniqueIDBDatabase::clearObjectStoreInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, int64_t objectStoreID)
@@ -797,7 +797,7 @@ void UniqueIDBDatabase::clearObjectStoreInBackingStore(uint64_t requestID, const
 
     bool success = m_backingStore->clearObjectStore(transactionIdentifier, objectStoreID);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didClearObjectStore, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didClearObjectStore, requestID, success));
 }
 
 void UniqueIDBDatabase::createIndexInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBIndexMetadata& metadata)
@@ -807,7 +807,7 @@ void UniqueIDBDatabase::createIndexInBackingStore(uint64_t requestID, const IDBI
 
     bool success = m_backingStore->createIndex(transactionIdentifier, objectStoreID, metadata);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCreateIndex, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCreateIndex, requestID, success));
 }
 
 void UniqueIDBDatabase::deleteIndexInBackingStore(uint64_t requestID, const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID)
@@ -817,7 +817,7 @@ void UniqueIDBDatabase::deleteIndexInBackingStore(uint64_t requestID, const IDBI
 
     bool success = m_backingStore->deleteIndex(transactionIdentifier, objectStoreID, indexID);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didDeleteIndex, requestID, success));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didDeleteIndex, requestID, success));
 }
 
 void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIdentifier& transaction, const IDBObjectStoreMetadata& objectStoreMetadata, const IDBKeyData& inputKeyData, const Vector<uint8_t>& value, int64_t putMode, const Vector<int64_t>& indexIDs, const Vector<Vector<IDBKeyData>>& indexKeys)
@@ -831,7 +831,7 @@ void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIde
 
     if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && inputKeyData.isNull) {
         if (!m_backingStore->generateKeyNumber(transaction, objectStoreMetadata.id, keyNumber)) {
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
             return;
         }
         key.setNumberValue(keyNumber);
@@ -842,11 +842,11 @@ void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIde
     if (putMode == IDBDatabaseBackend::AddOnly) {
         bool keyExists;
         if (!m_backingStore->keyExistsInObjectStore(transaction, objectStoreMetadata.id, key, keyExists)) {
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
             return;
         }
         if (keyExists) {
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::ConstraintError, ASCIILiteral("Key already exists in the object store")));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::ConstraintError, ASCIILiteral("Key already exists in the object store")));
             return;
         }
     }
@@ -854,12 +854,12 @@ void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIde
     // The spec says that even if we're about to overwrite the record, perform the steps to delete it first.
     // This is important because formally deleting it from from the object store also removes it from the appropriate indexes.
     if (!m_backingStore->deleteRecord(transaction, objectStoreMetadata.id, key)) {
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Replacing an existing key in backing store, unable to delete previous record.")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Replacing an existing key in backing store, unable to delete previous record.")));
         return;
     }
 
     if (!m_backingStore->putRecord(transaction, objectStoreMetadata.id, key, value.data(), value.size())) {
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error putting a record")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error putting a record")));
         return;
     }
 
@@ -867,7 +867,7 @@ void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIde
     for (size_t i = 0; i < indexIDs.size(); ++i) {
         for (size_t j = 0; j < indexKeys[i].size(); ++j) {
             if (!m_backingStore->putIndexRecord(transaction, objectStoreMetadata.id, indexIDs[i], key, indexKeys[i][j])) {
-                postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error writing index key")));
+                postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error writing index key")));
                 return;
             }
         }
@@ -877,12 +877,12 @@ void UniqueIDBDatabase::putRecordInBackingStore(uint64_t requestID, const IDBIde
 
     if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && key.type == KeyType::Number) {
         if (!m_backingStore->updateKeyGeneratorNumber(transaction, objectStoreMetadata.id, keyNumber, keyWasGenerated)) {
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error updating key generator")));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error updating key generator")));
             return;
         }
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, key, 0, String(StringImpl::empty())));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, key, 0, String(StringImpl::empty())));
 }
 
 void UniqueIDBDatabase::didPutRecordInBackingStore(uint64_t requestID, const IDBKeyData& keyData, uint32_t errorCode, const String& errorMessage)
@@ -898,7 +898,7 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
     RefPtr<IDBKeyRange> keyRange = keyRangeData.maybeCreateIDBKeyRange();
     ASSERT(keyRange);
     if (!keyRange) {
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Invalid IDBKeyRange requested from backing store")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Invalid IDBKeyRange requested from backing store")));
         return;
     }
 
@@ -908,10 +908,10 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
 
         if (keyRange->isOnlyKey()) {
             if (!m_backingStore->getKeyRecordFromObjectStore(transaction, objectStoreMetadata.id, *keyRange->lower(), result))
-                postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key record from object store in backing store")));
+                postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key record from object store in backing store")));
             else {
                 IDBGetResult getResult = result ? IDBGetResult(result.release(), keyRange->lower(), objectStoreMetadata.keyPath) : IDBGetResult();
-                postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
+                postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
             }
 
             return;
@@ -920,10 +920,10 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
         RefPtr<IDBKey> resultKey;
 
         if (!m_backingStore->getKeyRangeRecordFromObjectStore(transaction, objectStoreMetadata.id, *keyRange, result, resultKey))
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key range record from object store in backing store")));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get key range record from object store in backing store")));
         else {
             IDBGetResult getResult = result ? IDBGetResult(result.release(), resultKey.release(), objectStoreMetadata.keyPath) : IDBGetResult();
-            postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
+            postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, getResult, 0, String(StringImpl::empty())));
         }
 
         return;
@@ -933,14 +933,14 @@ void UniqueIDBDatabase::getRecordFromBackingStore(uint64_t requestID, const IDBI
 
     IDBGetResult result;
     if (!m_backingStore->getIndexRecord(transaction, objectStoreMetadata.id, indexID, keyRangeData, cursorType, result)) {
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get index record from backing store")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, IDBGetResult(), IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get index record from backing store")));
         return;
     }
 
     // We must return a key path to know how to inject the result key into the result value object.
     result.keyPath = objectStoreMetadata.keyPath;
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, result, 0, String(StringImpl::empty())));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didGetRecordFromBackingStore, requestID, result, 0, String(StringImpl::empty())));
 }
 
 void UniqueIDBDatabase::didGetRecordFromBackingStore(uint64_t requestID, const IDBGetResult& result, uint32_t errorCode, const String& errorMessage)
@@ -966,7 +966,7 @@ void UniqueIDBDatabase::openCursorInBackingStore(uint64_t requestID, const IDBId
         errorMessage = ASCIILiteral("Unknown error opening cursor in backing store");
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didOpenCursorInBackingStore, requestID, cursorID, key, primaryKey, valueBuffer, errorCode, errorMessage));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didOpenCursorInBackingStore, requestID, cursorID, key, primaryKey, valueBuffer, errorCode, errorMessage));
 }
 
 void UniqueIDBDatabase::didOpenCursorInBackingStore(uint64_t requestID, int64_t cursorID, const IDBKeyData& key, const IDBKeyData& primaryKey, const Vector<uint8_t>& valueBuffer, uint32_t errorCode, const String& errorMessage)
@@ -988,7 +988,7 @@ void UniqueIDBDatabase::advanceCursorInBackingStore(uint64_t requestID, const ID
         errorMessage = ASCIILiteral("Unknown error advancing cursor in backing store");
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didAdvanceCursorInBackingStore, requestID, key, primaryKey, valueBuffer, errorCode, errorMessage));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didAdvanceCursorInBackingStore, requestID, key, primaryKey, valueBuffer, errorCode, errorMessage));
 }
 
 void UniqueIDBDatabase::didAdvanceCursorInBackingStore(uint64_t requestID, const IDBKeyData& key, const IDBKeyData& primaryKey, const Vector<uint8_t>& valueBuffer, uint32_t errorCode, const String& errorMessage)
@@ -1010,7 +1010,7 @@ void UniqueIDBDatabase::iterateCursorInBackingStore(uint64_t requestID, const ID
         errorMessage = ASCIILiteral("Unknown error iterating cursor in backing store");
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didIterateCursorInBackingStore, requestID, key, primaryKey, valueBuffer, errorCode, errorMessage));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didIterateCursorInBackingStore, requestID, key, primaryKey, valueBuffer, errorCode, errorMessage));
 }
 
 void UniqueIDBDatabase::didIterateCursorInBackingStore(uint64_t requestID, const IDBKeyData& key, const IDBKeyData& primaryKey, const Vector<uint8_t>& valueBuffer, uint32_t errorCode, const String& errorMessage)
@@ -1024,12 +1024,12 @@ void UniqueIDBDatabase::countInBackingStore(uint64_t requestID, const IDBIdentif
 
     if (!m_backingStore->count(transactionIdentifier, objectStoreID, indexID, keyRangeData, count)) {
         LOG_ERROR("Failed to get count from backing store.");
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCountInBackingStore, requestID, 0, IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get count from backing store")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCountInBackingStore, requestID, 0, IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get count from backing store")));
 
         return;
     }
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didCountInBackingStore, requestID, count, 0, String(StringImpl::empty())));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didCountInBackingStore, requestID, count, 0, String(StringImpl::empty())));
 }
 
 void UniqueIDBDatabase::didCountInBackingStore(uint64_t requestID, int64_t count, uint32_t errorCode, const String& errorMessage)
@@ -1041,14 +1041,14 @@ void UniqueIDBDatabase::deleteRangeInBackingStore(uint64_t requestID, const IDBI
 {
     if (!m_backingStore->deleteRange(transactionIdentifier, objectStoreID, keyRangeData)) {
         LOG_ERROR("Failed to delete range from backing store.");
-        postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didDeleteRangeInBackingStore, requestID, IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get count from backing store")));
+        postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didDeleteRangeInBackingStore, requestID, IDBDatabaseException::UnknownError, ASCIILiteral("Failed to get count from backing store")));
 
         return;
     }
 
     m_backingStore->notifyCursorsOfChanges(transactionIdentifier, objectStoreID);
 
-    postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didDeleteRangeInBackingStore, requestID, 0, String(StringImpl::empty())));
+    postMainThreadTask(createCrossThreadTask(*this, &UniqueIDBDatabase::didDeleteRangeInBackingStore, requestID, 0, String(StringImpl::empty())));
 }
 
 void UniqueIDBDatabase::didDeleteRangeInBackingStore(uint64_t requestID, uint32_t errorCode, const String& errorMessage)
@@ -1118,7 +1118,7 @@ String UniqueIDBDatabase::absoluteDatabaseDirectory() const
     return DatabaseProcess::singleton().absoluteIndexedDatabasePathFromDatabaseRelativePath(m_databaseRelativeDirectory);
 }
 
-void UniqueIDBDatabase::postMainThreadTask(std::unique_ptr<AsyncTask> task, DatabaseTaskType taskType)
+void UniqueIDBDatabase::postMainThreadTask(std::unique_ptr<CrossThreadTask> task, DatabaseTaskType taskType)
 {
     ASSERT(!RunLoop::isMain());
 
@@ -1141,7 +1141,7 @@ bool UniqueIDBDatabase::performNextMainThreadTask()
 
     bool moreTasks;
 
-    std::unique_ptr<AsyncTask> task;
+    std::unique_ptr<CrossThreadTask> task;
     {
         LockHolder locker(m_mainThreadTaskMutex);
 
@@ -1158,7 +1158,7 @@ bool UniqueIDBDatabase::performNextMainThreadTask()
     return moreTasks;
 }
 
-void UniqueIDBDatabase::postDatabaseTask(std::unique_ptr<AsyncTask> task, DatabaseTaskType taskType)
+void UniqueIDBDatabase::postDatabaseTask(std::unique_ptr<CrossThreadTask> task, DatabaseTaskType taskType)
 {
     ASSERT(RunLoop::isMain());
 
@@ -1184,7 +1184,7 @@ void UniqueIDBDatabase::performNextDatabaseTask()
     // We take a ref() to make sure the database is still live while this last task is performed.
     RefPtr<UniqueIDBDatabase> protector(this);
 
-    std::unique_ptr<AsyncTask> task;
+    std::unique_ptr<CrossThreadTask> task;
     {
         LockHolder locker(m_databaseTaskMutex);
 
index ee334e3..441613e 100644 (file)
@@ -56,7 +56,7 @@ struct SecurityOriginData;
 
 namespace WebKit {
 
-class AsyncTask;
+class CrossThreadTask;
 class DatabaseProcessIDBConnection;
 class UniqueIDBDatabaseBackingStore;
 
@@ -125,7 +125,7 @@ private:
         Normal,
         Shutdown
     };
-    void postDatabaseTask(std::unique_ptr<AsyncTask>, DatabaseTaskType = DatabaseTaskType::Normal);
+    void postDatabaseTask(std::unique_ptr<CrossThreadTask>, DatabaseTaskType = DatabaseTaskType::Normal);
 
     void shutdown(UniqueIDBDatabaseShutdownType);
 
@@ -138,11 +138,11 @@ private:
     // Returns true if this origin can use the same databases as the given origin.
     bool canShareDatabases(const WebCore::SecurityOriginData&, const WebCore::SecurityOriginData&) const;
 
-    void postTransactionOperation(const IDBIdentifier& transactionIdentifier, std::unique_ptr<AsyncTask>, std::function<void (bool)> successCallback);
+    void postTransactionOperation(const IDBIdentifier& transactionIdentifier, std::unique_ptr<CrossThreadTask>, std::function<void (bool)> successCallback);
     
     // To be called from the database workqueue thread only
     void performNextDatabaseTask();
-    void postMainThreadTask(std::unique_ptr<AsyncTask>, DatabaseTaskType = DatabaseTaskType::Normal);
+    void postMainThreadTask(std::unique_ptr<CrossThreadTask>, DatabaseTaskType = DatabaseTaskType::Normal);
     void openBackingStoreAndReadMetadata(const UniqueIDBDatabaseIdentifier&, const String& databaseDirectory);
     void openBackingStoreTransaction(const IDBIdentifier& transactionIdentifier, const Vector<int64_t>& objectStoreIDs, WebCore::IndexedDB::TransactionMode);
     void beginBackingStoreTransaction(const IDBIdentifier&);
@@ -208,10 +208,10 @@ private:
 
     RefPtr<UniqueIDBDatabaseBackingStore> m_backingStore;
 
-    Deque<std::unique_ptr<AsyncTask>> m_databaseTasks;
+    Deque<std::unique_ptr<CrossThreadTask>> m_databaseTasks;
     Lock m_databaseTaskMutex;
 
-    Deque<std::unique_ptr<AsyncTask>> m_mainThreadTasks;
+    Deque<std::unique_ptr<CrossThreadTask>> m_mainThreadTasks;
     Lock m_mainThreadTaskMutex;
 };
 
index 1469253..aafc4a1 100644 (file)
                51AD35731AD2F3940057B38E /* WebHitTestResult.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51AD35721AD2F3750057B38E /* WebHitTestResult.mm */; };
                51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; };
                51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
-               51BA24441858EE3000EA2811 /* AsyncTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BA24431858EE3000EA2811 /* AsyncTask.h */; };
                51BA24461858F55D00EA2811 /* WebCrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */; };
                51C96118183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51C96116183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp */; };
                51C96119183D294700D2002E /* WebIDBServerConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C96117183D294700D2002E /* WebIDBServerConnectionMessages.h */; };
                51AD35721AD2F3750057B38E /* WebHitTestResult.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHitTestResult.mm; sourceTree = "<group>"; };
                51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = "<group>"; };
                51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = "<group>"; };
-               51BA24431858EE3000EA2811 /* AsyncTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncTask.h; sourceTree = "<group>"; };
                51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCrossThreadCopier.cpp; sourceTree = "<group>"; };
                51C96115183C95FF00D2002E /* WebIDBServerConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebIDBServerConnection.messages.in; sourceTree = "<group>"; };
                51C96116183D294700D2002E /* WebIDBServerConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBServerConnectionMessageReceiver.cpp; sourceTree = "<group>"; };
                                C59C4A5718B81174007BDCB6 /* AssistedNodeInformation.h */,
                                515E7725183DD6F60007203F /* AsyncRequest.cpp */,
                                515E7726183DD6F60007203F /* AsyncRequest.h */,
-                               51BA24431858EE3000EA2811 /* AsyncTask.h */,
                                E164A2EF191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.cpp */,
                                E164A2F0191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.h */,
                                4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */,
                                CE1A0BD21A48E6C60054EF74 /* AssertionServicesSPI.h in Headers */,
                                C59C4A5918B81174007BDCB6 /* AssistedNodeInformation.h in Headers */,
                                515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
-                               51BA24441858EE3000EA2811 /* AsyncTask.h in Headers */,
                                BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */,
                                E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */,
                                512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,