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

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

Issue 2037233002: Revert of Enable per thread heap for database thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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/webdatabase/DatabaseThread.cpp
diff --git a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
index 0fe57779d626c97a50d2be7e6cbd5196211625da..c73e968fc0f5e00a24d28bb06e10480478c3c955 100644
--- a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
@@ -41,10 +41,10 @@
DatabaseThread::DatabaseThread()
: m_transactionClient(adoptPtr(new SQLTransactionClient()))
+ , m_transactionCoordinator(new SQLTransactionCoordinator())
, m_cleanupSync(nullptr)
, m_terminationRequested(false)
{
- DCHECK(isMainThread());
}
DatabaseThread::~DatabaseThread()
@@ -55,6 +55,8 @@
DEFINE_TRACE(DatabaseThread)
{
+ visitor->trace(m_openDatabaseSet);
+ visitor->trace(m_transactionCoordinator);
}
void DatabaseThread::start()
@@ -62,14 +64,13 @@
ASSERT(isMainThread());
if (m_thread)
return;
- m_thread = WebThreadSupportingGC::create("WebCore: Database", true);
+ m_thread = WebThreadSupportingGC::create("WebCore: Database");
m_thread->postTask(BLINK_FROM_HERE, threadSafeBind(&DatabaseThread::setupDatabaseThread, wrapCrossThreadPersistent(this)));
}
void DatabaseThread::setupDatabaseThread()
{
m_thread->initialize();
- m_transactionCoordinator = new SQLTransactionCoordinator();
}
void DatabaseThread::terminate()
@@ -93,8 +94,6 @@
void DatabaseThread::cleanupDatabaseThread()
{
- DCHECK(isDatabaseThread());
-
WTF_LOG(StorageAPI, "Cleaning up DatabaseThread %p", this);
// Clean up the list of all pending transactions on this database thread
@@ -104,10 +103,10 @@
// inconsistent or locked state.
if (m_openDatabaseSet.size() > 0) {
// As the call to close will modify the original set, we must take a copy to iterate over.
- HashSet<CrossThreadPersistent<Database>> openSetCopy;
+ HeapHashSet<Member<Database>> openSetCopy;
openSetCopy.swap(m_openDatabaseSet);
- HashSet<CrossThreadPersistent<Database>>::iterator end = openSetCopy.end();
- for (HashSet<CrossThreadPersistent<Database>>::iterator it = openSetCopy.begin(); it != end; ++it)
+ HeapHashSet<Member<Database>>::iterator end = openSetCopy.end();
+ for (HeapHashSet<Member<Database>>::iterator it = openSetCopy.begin(); it != end; ++it)
(*it)->close();
}
m_openDatabaseSet.clear();

Powered by Google App Engine
This is Rietveld 408576698