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

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

Issue 657023003: Tentative fix of a crash in Oilpan GC after a database thread termination. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | 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 d074e362041c67f51eb6083f0b07a6cdccfb2383..80574b616991586e6efc910279f87e6d487b3ea9 100644
--- a/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/Source/modules/webdatabase/DatabaseThread.cpp
@@ -114,6 +114,7 @@ void DatabaseThread::cleanupDatabaseThread()
for (HeapHashSet<Member<Database> >::iterator it = openSetCopy.begin(); it != end; ++it)
(*it)->close();
}
+ m_openDatabaseSet.clear();
m_thread->postTask(new Task(WTF::bind(&DatabaseThread::cleanupDatabaseThreadCompleted, this)));
haraken 2014/10/15 08:20:18 Just help me understand: Why do we need to post th
tkent 2014/10/15 08:41:22 I don't remember the reason. Anyway, it's unrelat
}
@@ -130,7 +131,9 @@ void DatabaseThread::recordDatabaseOpen(Database* database)
ASSERT(isDatabaseThread());
ASSERT(database);
ASSERT(!m_openDatabaseSet.contains(database));
- m_openDatabaseSet.add(database);
+ MutexLocker lock(m_terminationRequestedMutex);
+ if (!m_terminationRequested)
+ m_openDatabaseSet.add(database);
}
void DatabaseThread::recordDatabaseClosed(Database* database)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698