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

Unified Diff: Source/core/workers/WorkerThread.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/core/workers/WorkerThread.h ('k') | Source/modules/compositorworker/CompositorWorkerManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerThread.cpp
diff --git a/Source/core/workers/WorkerThread.cpp b/Source/core/workers/WorkerThread.cpp
index 845c6a77162bde9868748b97dc1360e8543fbd58..5c0b410876bd36448b622d837a969523647b7de1 100644
--- a/Source/core/workers/WorkerThread.cpp
+++ b/Source/core/workers/WorkerThread.cpp
@@ -439,8 +439,8 @@ v8::Isolate* WorkerThread::initializeIsolate()
v8::Isolate* isolate = V8PerIsolateData::initialize();
V8Initializer::initializeWorker(isolate);
- m_interruptor = adoptPtr(new V8IsolateInterruptor(isolate));
- ThreadState::current()->addInterruptor(m_interruptor.get());
+ OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor(isolate));
+ ThreadState::current()->addInterruptor(interruptor.release());
ThreadState::current()->registerTraceDOMWrappers(isolate, V8GCController::traceDOMWrappers);
return isolate;
@@ -451,7 +451,6 @@ void WorkerThread::willDestroyIsolate()
ASSERT(isCurrentThread());
ASSERT(m_isolate);
V8PerIsolateData::willBeDestroyed(m_isolate);
- ThreadState::current()->removeInterruptor(m_interruptor.get());
}
void WorkerThread::destroyIsolate()
« no previous file with comments | « Source/core/workers/WorkerThread.h ('k') | Source/modules/compositorworker/CompositorWorkerManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698