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

Unified Diff: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp

Issue 2097253002: Remove ExecutionContextTask subclasses from DOMFileSystem (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ECT_TaskName
Patch Set: 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
Index: third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
diff --git a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
index 34c58f2c8e3597a53bcd0087ce3f69c5cf225edf..d4c1a0434f7f7dd0471d7be5127a6547f45dbbbe 100644
--- a/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/FileSystemCallbacks.cpp
@@ -86,10 +86,12 @@ template <typename CB, typename CBArg>
void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback, CBArg* arg)
{
ASSERT(callback);
- if (shouldScheduleCallback())
- DOMFileSystem::scheduleCallback(m_executionContext.get(), callback, arg);
- else if (callback)
- callback->handleEvent(arg);
+ if (callback) {
+ if (shouldScheduleCallback())
+ DOMFileSystem::scheduleCallback(m_executionContext.get(), createSameThreadTask(&CB::handleEvent, wrapPersistent(callback), wrapPersistent(arg)));
+ else
+ callback->handleEvent(arg);
+ }
m_executionContext.clear();
}
@@ -97,10 +99,12 @@ template <typename CB>
void FileSystemCallbacksBase::handleEventOrScheduleCallback(CB* callback)
{
ASSERT(callback);
- if (shouldScheduleCallback())
- DOMFileSystem::scheduleCallback(m_executionContext.get(), callback);
- else if (callback)
- callback->handleEvent();
+ if (callback) {
+ if (shouldScheduleCallback())
+ DOMFileSystem::scheduleCallback(m_executionContext.get(), createSameThreadTask(&CB::handleEvent, wrapPersistent(callback)));
+ else
+ callback->handleEvent();
+ }
m_executionContext.clear();
}

Powered by Google App Engine
This is Rietveld 408576698