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

Unified Diff: Source/core/html/parser/HTMLParserThread.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/core/html/parser/HTMLParserThread.h ('k') | Source/core/workers/WorkerThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « Source/core/html/parser/HTMLParserThread.h ('k') | Source/core/workers/WorkerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698