Index: Source/core/html/parser/HTMLParserThread.cpp |
diff --git a/Source/core/html/parser/HTMLParserThread.cpp b/Source/core/html/parser/HTMLParserThread.cpp |
index aeaca7dc87f97c2da70eab6aed9ee96d936713c1..76397db72ca40ff478341a79dd8b33c75a69cdda 100644 |
--- a/Source/core/html/parser/HTMLParserThread.cpp |
+++ b/Source/core/html/parser/HTMLParserThread.cpp |
@@ -56,11 +56,8 @@ void HTMLParserThread::init() |
void HTMLParserThread::setupHTMLParserThread() |
{ |
- m_pendingGCRunner = adoptPtr(new PendingGCRunner); |
- m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(&platformThread())); |
- platformThread().addTaskObserver(m_pendingGCRunner.get()); |
- ThreadState::attach(); |
- ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get()); |
+ ASSERT(m_thread); |
+ m_thread->attachGC(); |
} |
void HTMLParserThread::shutdown() |
@@ -78,11 +75,7 @@ void HTMLParserThread::shutdown() |
void HTMLParserThread::cleanupHTMLParserThread(TaskSynchronizer* taskSynchronizer) |
{ |
- ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get()); |
- ThreadState::detach(); |
- platformThread().removeTaskObserver(m_pendingGCRunner.get()); |
- m_pendingGCRunner = nullptr; |
- m_messageLoopInterruptor = nullptr; |
+ m_thread->detachGC(); |
taskSynchronizer->taskCompleted(); |
} |
@@ -94,10 +87,10 @@ HTMLParserThread* HTMLParserThread::shared() |
blink::WebThread& HTMLParserThread::platformThread() |
{ |
if (!isRunning()) { |
- m_thread = adoptPtr(blink::Platform::current()->createThread("HTMLParserThread")); |
+ m_thread = WebThreadSupportingGC::create("HTMLParserThread"); |
postTask(WTF::bind(&HTMLParserThread::setupHTMLParserThread, this)); |
} |
- return *m_thread; |
+ return m_thread->platformThread(); |
} |
bool HTMLParserThread::isRunning() |