Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(533)

Unified Diff: third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp

Issue 1766903002: Remove ExecutionContextTask subclasses that have task names (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Kuroneko_EC7_Document
Patch Set: Add a comment Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/StringCallback.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
index 6e79090d655630b4d8000258deb2710d6421bb2f..439d65d6a96f4c193cce6db86344eebaab4c56c5 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
@@ -75,28 +75,11 @@ DatabaseManager::~DatabaseManager()
{
}
-class DatabaseCreationCallbackTask final : public ExecutionContextTask {
-public:
- static std::unique_ptr<DatabaseCreationCallbackTask> create(Database* database, DatabaseCallback* creationCallback)
- {
- return wrapUnique(new DatabaseCreationCallbackTask(database, creationCallback));
- }
-
- void performTask(ExecutionContext*) override
- {
- m_creationCallback->handleEvent(m_database.get());
- }
-
-private:
- DatabaseCreationCallbackTask(Database* database, DatabaseCallback* callback)
- : m_database(database)
- , m_creationCallback(callback)
- {
- }
-
- Persistent<Database> m_database;
- Persistent<DatabaseCallback> m_creationCallback;
-};
+// This is just for ignoring DatabaseCallback::handleEvent()'s return value.
+static void databaseCallbackHandleEvent(DatabaseCallback* callback, Database* database)
+{
+ callback->handleEvent(database);
+}
DatabaseContext* DatabaseManager::existingDatabaseContextFor(ExecutionContext* context)
{
@@ -214,7 +197,7 @@ Database* DatabaseManager::openDatabase(ExecutionContext* context,
if (database->isNew() && creationCallback) {
WTF_LOG(StorageAPI, "Scheduling DatabaseCreationCallbackTask for database %p\n", database);
- database->getExecutionContext()->postTask(BLINK_FROM_HERE, DatabaseCreationCallbackTask::create(database, creationCallback), "openDatabase");
+ database->getExecutionContext()->postTask(BLINK_FROM_HERE, createSameThreadTask(&databaseCallbackHandleEvent, wrapPersistent(creationCallback), wrapPersistent(database)), "openDatabase");
}
ASSERT(database);
« no previous file with comments | « third_party/WebKit/Source/core/dom/StringCallback.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698