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

Unified Diff: Source/modules/webdatabase/DatabaseThread.cpp

Issue 593423002: Revert of DatabaseBackend should not post a task to an already terminated database thread (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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 | « Source/modules/webdatabase/DatabaseThread.h ('k') | Source/platform/TaskSynchronizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webdatabase/DatabaseThread.cpp
diff --git a/Source/modules/webdatabase/DatabaseThread.cpp b/Source/modules/webdatabase/DatabaseThread.cpp
index 2fdfec70175e376872234049dec17d19973e5757..f3eeb14916ce6c5152192d5e411655b5cf9c10c5 100644
--- a/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/Source/modules/webdatabase/DatabaseThread.cpp
@@ -91,8 +91,13 @@
m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread, this)));
}
-bool DatabaseThread::terminationRequested() const
+bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) const
{
+#if ENABLE(ASSERT)
+ if (taskSynchronizer)
+ taskSynchronizer->setHasCheckedForTermination();
+#endif
+
MutexLocker lock(m_terminationRequestedMutex);
return m_terminationRequested;
}
@@ -152,7 +157,7 @@
void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
{
ASSERT(m_thread);
- ASSERT(!terminationRequested());
+ ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
// WebThread takes ownership of the task.
m_thread->postTask(task.leakPtr());
}
« no previous file with comments | « Source/modules/webdatabase/DatabaseThread.h ('k') | Source/platform/TaskSynchronizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698