Index: Source/platform/WebThreadSupportingGC.cpp |
diff --git a/Source/platform/WebThreadSupportingGC.cpp b/Source/platform/WebThreadSupportingGC.cpp |
index cac7795876ae25a36bad6e981ec72474b866e6eb..295bbfb4d0b4cfbbabe751739391a8d3520f9670 100644 |
--- a/Source/platform/WebThreadSupportingGC.cpp |
+++ b/Source/platform/WebThreadSupportingGC.cpp |
@@ -6,6 +6,7 @@ |
#include "platform/WebThreadSupportingGC.h" |
#include "platform/heap/SafePoint.h" |
+#include "public/platform/WebScheduler.h" |
#include "wtf/Threading.h" |
namespace blink { |
@@ -32,7 +33,7 @@ WebThreadSupportingGC::~WebThreadSupportingGC() |
} |
} |
-void WebThreadSupportingGC::attachGC() |
+void WebThreadSupportingGC::initialize() |
{ |
m_pendingGCRunner = adoptPtr(new PendingGCRunner); |
m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(&platformThread())); |
@@ -41,13 +42,16 @@ void WebThreadSupportingGC::attachGC() |
ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get()); |
} |
-void WebThreadSupportingGC::detachGC() |
+void WebThreadSupportingGC::shutdown() |
{ |
ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get()); |
ThreadState::detach(); |
platformThread().removeTaskObserver(m_pendingGCRunner.get()); |
m_pendingGCRunner = nullptr; |
m_messageLoopInterruptor = nullptr; |
+ |
+ // Ensure no posted tasks will run from this point on. |
+ platformThread().scheduler()->shutdown(); |
} |
} // namespace blink |