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

Unified Diff: Source/platform/WebThreadSupportingGC.cpp

Issue 1257723002: Simplify ownership of a ThreadState's interruptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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
Index: Source/platform/WebThreadSupportingGC.cpp
diff --git a/Source/platform/WebThreadSupportingGC.cpp b/Source/platform/WebThreadSupportingGC.cpp
index 11f67b10a9483943528189b9f59c4e18764e10dd..00994df2ce642b537a7f03f2719184275b4fcefd 100644
--- a/Source/platform/WebThreadSupportingGC.cpp
+++ b/Source/platform/WebThreadSupportingGC.cpp
@@ -36,10 +36,9 @@ WebThreadSupportingGC::~WebThreadSupportingGC()
void WebThreadSupportingGC::initialize()
{
m_pendingGCRunner = adoptPtr(new PendingGCRunner);
- m_messageLoopInterruptor = adoptPtr(new MessageLoopInterruptor(&platformThread()));
platformThread().addTaskObserver(m_pendingGCRunner.get());
ThreadState::attach();
- ThreadState::current()->addInterruptor(m_messageLoopInterruptor.get());
+ ThreadState::current()->addInterruptor(new MessageLoopInterruptor(&platformThread()));
}
void WebThreadSupportingGC::shutdown()
@@ -48,10 +47,8 @@ void WebThreadSupportingGC::shutdown()
platformThread().removeTaskObserver(m_pendingGCRunner.get());
platformThread().scheduler()->shutdown();
- ThreadState::current()->removeInterruptor(m_messageLoopInterruptor.get());
ThreadState::detach();
m_pendingGCRunner = nullptr;
- m_messageLoopInterruptor = nullptr;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698