| 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 c73e968fc0f5e00a24d28bb06e10480478c3c955..0fe57779d626c97a50d2be7e6cbd5196211625da 100644
|
| --- a/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
|
| +++ b/third_party/WebKit/Source/modules/webdatabase/DatabaseThread.cpp
|
| @@ -41,10 +41,10 @@ namespace blink {
|
|
|
| DatabaseThread::DatabaseThread()
|
| : m_transactionClient(adoptPtr(new SQLTransactionClient()))
|
| - , m_transactionCoordinator(new SQLTransactionCoordinator())
|
| , m_cleanupSync(nullptr)
|
| , m_terminationRequested(false)
|
| {
|
| + DCHECK(isMainThread());
|
| }
|
|
|
| DatabaseThread::~DatabaseThread()
|
| @@ -55,8 +55,6 @@ DatabaseThread::~DatabaseThread()
|
|
|
| DEFINE_TRACE(DatabaseThread)
|
| {
|
| - visitor->trace(m_openDatabaseSet);
|
| - visitor->trace(m_transactionCoordinator);
|
| }
|
|
|
| void DatabaseThread::start()
|
| @@ -64,13 +62,14 @@ void DatabaseThread::start()
|
| ASSERT(isMainThread());
|
| if (m_thread)
|
| return;
|
| - m_thread = WebThreadSupportingGC::create("WebCore: Database");
|
| + m_thread = WebThreadSupportingGC::create("WebCore: Database", true);
|
| m_thread->postTask(BLINK_FROM_HERE, threadSafeBind(&DatabaseThread::setupDatabaseThread, wrapCrossThreadPersistent(this)));
|
| }
|
|
|
| void DatabaseThread::setupDatabaseThread()
|
| {
|
| m_thread->initialize();
|
| + m_transactionCoordinator = new SQLTransactionCoordinator();
|
| }
|
|
|
| void DatabaseThread::terminate()
|
| @@ -94,6 +93,8 @@ void DatabaseThread::terminate()
|
|
|
| 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
|
| @@ -103,10 +104,10 @@ void DatabaseThread::cleanupDatabaseThread()
|
| // 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.
|
| - HeapHashSet<Member<Database>> openSetCopy;
|
| + HashSet<CrossThreadPersistent<Database>> openSetCopy;
|
| openSetCopy.swap(m_openDatabaseSet);
|
| - HeapHashSet<Member<Database>>::iterator end = openSetCopy.end();
|
| - for (HeapHashSet<Member<Database>>::iterator it = openSetCopy.begin(); it != end; ++it)
|
| + HashSet<CrossThreadPersistent<Database>>::iterator end = openSetCopy.end();
|
| + for (HashSet<CrossThreadPersistent<Database>>::iterator it = openSetCopy.begin(); it != end; ++it)
|
| (*it)->close();
|
| }
|
| m_openDatabaseSet.clear();
|
|
|