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

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

Issue 469683002: Implement WebThreadSupportingGC, which wraps a WebThread attached to Oilpan's GC (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/WebThreadSupportingGC.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 1c0f4f0890d31f5d4d9f5117556e6b8fea89193a..92bd6faaafd082a2364a2d812cd30e194366c29b 100644
--- a/Source/modules/webdatabase/DatabaseThread.cpp
+++ b/Source/modules/webdatabase/DatabaseThread.cpp
@@ -72,17 +72,13 @@ void DatabaseThread::start()
{
if (m_thread)
return;
- m_thread = adoptPtr(Platform::current()->createThread("WebCore: Database"));
+ m_thread = WebThreadSupportingGC::create("WebCore: Database");
m_thread->postTask(new Task(WTF::bind(&DatabaseThread::setupDatabaseThread, this)));
}
void DatabaseThread::setupDatabaseThread()
{
- m_pendingGCRunner = adoptPtr(new PendingGCRunner);
- m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(m_thread.get()));
- m_thread->addTaskObserver(m_pendingGCRunner.get());
- ThreadState::attach();
- ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get());
+ m_thread->attachGC();
}
void DatabaseThread::requestTermination(TaskSynchronizer *cleanupSync)
@@ -129,12 +125,7 @@ void DatabaseThread::cleanupDatabaseThread()
void DatabaseThread::cleanupDatabaseThreadCompleted()
{
- ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get());
- ThreadState::detach();
- // We need to unregister PendingGCRunner before finising this task to avoid
- // PendingGCRunner::didProcessTask accesses dead ThreadState.
- m_thread->removeTaskObserver(m_pendingGCRunner.get());
-
+ m_thread->detachGC();
if (m_cleanupSync) // Someone wanted to know when we were done cleaning up.
m_cleanupSync->taskCompleted();
}
« no previous file with comments | « Source/modules/webdatabase/DatabaseThread.h ('k') | Source/platform/WebThreadSupportingGC.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698