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

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

Issue 596083005: 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 f3eeb14916ce6c5152192d5e411655b5cf9c10c5..2fdfec70175e376872234049dec17d19973e5757 100644
--- a/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/Source/modules/webdatabase/DatabaseThread.cpp
@@ -91,13 +91,8 @@ void DatabaseThread::requestTermination(TaskSynchronizer *cleanupSync)
m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThread, this)));
}
-bool DatabaseThread::terminationRequested(TaskSynchronizer* taskSynchronizer) const
+bool DatabaseThread::terminationRequested() const
{
-#if ENABLE(ASSERT)
- if (taskSynchronizer)
- taskSynchronizer->setHasCheckedForTermination();
-#endif
-
MutexLocker lock(m_terminationRequestedMutex);
return m_terminationRequested;
}
@@ -157,7 +152,7 @@ bool DatabaseThread::isDatabaseOpen(Database* database)
void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
{
ASSERT(m_thread);
- ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
+ ASSERT(!terminationRequested());
// 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