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

Unified Diff: Source/platform/WebThreadSupportingGC.cpp

Issue 1111693003: Remove the concept of a cleanup task (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Don't run tasks if thread was never initialized. Created 5 years, 7 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/platform/WebThreadSupportingGC.h ('k') | public/platform/WebScheduler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/WebThreadSupportingGC.cpp
diff --git a/Source/platform/WebThreadSupportingGC.cpp b/Source/platform/WebThreadSupportingGC.cpp
index cac7795876ae25a36bad6e981ec72474b866e6eb..11f67b10a9483943528189b9f59c4e18764e10dd 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,11 +42,14 @@ void WebThreadSupportingGC::attachGC()
ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get());
}
-void WebThreadSupportingGC::detachGC()
+void WebThreadSupportingGC::shutdown()
{
+ // Ensure no posted tasks will run from this point on.
+ platformThread().removeTaskObserver(m_pendingGCRunner.get());
+ platformThread().scheduler()->shutdown();
+
ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get());
ThreadState::detach();
- platformThread().removeTaskObserver(m_pendingGCRunner.get());
m_pendingGCRunner = nullptr;
m_messageLoopInterruptor = nullptr;
}
« no previous file with comments | « Source/platform/WebThreadSupportingGC.h ('k') | public/platform/WebScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698