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

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

Issue 2698153003: Reduce createSameThreadTask usage in modules/ (Closed)
Patch Set: Move a static callback to an anonymous namespace Created 3 years, 10 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/modules/webdatabase/Database.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 7902c510222e4323e5df220d8cc344c6f383531e..6ded8df0b5b95539474e5ff8fd99516be22efed4 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseManager.cpp
@@ -29,9 +29,9 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
-#include "core/dom/ExecutionContextTask.h"
#include "core/dom/TaskRunnerHelper.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/inspector/InspectorInstrumentation.h"
#include "modules/webdatabase/Database.h"
#include "modules/webdatabase/DatabaseCallback.h"
#include "modules/webdatabase/DatabaseClient.h"
@@ -63,6 +63,8 @@ DatabaseManager::~DatabaseManager() {}
// This is just for ignoring DatabaseCallback::handleEvent()'s return value.
static void databaseCallbackHandleEvent(DatabaseCallback* callback,
Database* database) {
+ InspectorInstrumentation::AsyncTask asyncTask(database->getExecutionContext(),
+ callback);
callback->handleEvent(database);
}
@@ -196,12 +198,13 @@ Database* DatabaseManager::openDatabase(ExecutionContext* context,
if (database->isNew() && creationCallback) {
STORAGE_DVLOG(1) << "Scheduling DatabaseCreationCallbackTask for database "
<< database;
- database->getExecutionContext()->postTask(
- TaskType::DatabaseAccess, BLINK_FROM_HERE,
- createSameThreadTask(&databaseCallbackHandleEvent,
- wrapPersistent(creationCallback),
- wrapPersistent(database)),
- "openDatabase");
+ InspectorInstrumentation::asyncTaskScheduled(
+ database->getExecutionContext(), "openDatabase", creationCallback);
+ TaskRunnerHelper::get(TaskType::DatabaseAccess,
+ database->getExecutionContext())
+ ->postTask(BLINK_FROM_HERE, WTF::bind(&databaseCallbackHandleEvent,
+ wrapPersistent(creationCallback),
+ wrapPersistent(database)));
}
ASSERT(database);
« no previous file with comments | « third_party/WebKit/Source/modules/webdatabase/Database.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698