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

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
Index: Source/modules/webdatabase/DatabaseThread.cpp
diff --git a/Source/modules/webdatabase/DatabaseThread.cpp b/Source/modules/webdatabase/DatabaseThread.cpp
index 92bd6faaafd082a2364a2d812cd30e194366c29b..9d36272f48254d600ca167d67e76b970e335e039 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(DatabaseBackend* database)
void DatabaseThread::scheduleTask(PassOwnPtr<DatabaseTask> task)
{
ASSERT(m_thread);
- ASSERT(!task->hasSynchronizer() || task->hasCheckedForTermination());
+ ASSERT(!terminationRequested());
haraken 2014/09/24 01:06:27 This is a stronger (more straightforward) way to v
// WebThread takes ownership of the task.
m_thread->postTask(task.leakPtr());
}

Powered by Google App Engine
This is Rietveld 408576698