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

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: Switch addInterruptor() to take a PassOwnPtr<> 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
« no previous file with comments | « Source/platform/WebThreadSupportingGC.h ('k') | Source/platform/heap/SafePoint.cpp » ('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 11f67b10a9483943528189b9f59c4e18764e10dd..f2aec3e1addf011c63eaf4c1a887c67e01faa58e 100644
--- a/Source/platform/WebThreadSupportingGC.cpp
+++ b/Source/platform/WebThreadSupportingGC.cpp
@@ -36,10 +36,10 @@ 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());
+ OwnPtr<MessageLoopInterruptor> interruptor = adoptPtr(new MessageLoopInterruptor(&platformThread()));
+ ThreadState::current()->addInterruptor(interruptor.release());
}
void WebThreadSupportingGC::shutdown()
@@ -48,10 +48,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
« no previous file with comments | « Source/platform/WebThreadSupportingGC.h ('k') | Source/platform/heap/SafePoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698