| Index: Source/web/WebKit.cpp
|
| diff --git a/Source/web/WebKit.cpp b/Source/web/WebKit.cpp
|
| index a07d210d4651762f8f2377cf55b05d4019bb0734..5e9638c9433ed6b48d9ca8ca44b156bcd88f6969 100644
|
| --- a/Source/web/WebKit.cpp
|
| +++ b/Source/web/WebKit.cpp
|
| @@ -101,8 +101,6 @@ private:
|
|
|
| static WebThread::TaskObserver* s_endOfTaskRunner = 0;
|
| static WebThread::TaskObserver* s_pendingGCRunner = 0;
|
| -static ThreadState::Interruptor* s_messageLoopInterruptor = 0;
|
| -static ThreadState::Interruptor* s_isolateInterruptor = 0;
|
|
|
| // Make sure we are not re-initialized in the same address space.
|
| // Doing so may cause hard to reproduce crashes.
|
| @@ -114,8 +112,8 @@ void initialize(Platform* platform)
|
|
|
| V8Initializer::initializeMainThreadIfNeeded();
|
|
|
| - s_isolateInterruptor = new V8IsolateInterruptor(V8PerIsolateData::mainThreadIsolate());
|
| - ThreadState::current()->addInterruptor(s_isolateInterruptor);
|
| + OwnPtr<V8IsolateInterruptor> interruptor = adoptPtr(new V8IsolateInterruptor(V8PerIsolateData::mainThreadIsolate()));
|
| + ThreadState::current()->addInterruptor(interruptor.release());
|
| ThreadState::current()->registerTraceDOMWrappers(V8PerIsolateData::mainThreadIsolate(), V8GCController::traceDOMWrappers);
|
|
|
| // currentThread is null if we are running on a thread without a message loop.
|
| @@ -186,9 +184,8 @@ void initializeWithoutV8(Platform* platform)
|
| s_pendingGCRunner = new PendingGCRunner;
|
| currentThread->addTaskObserver(s_pendingGCRunner);
|
|
|
| - ASSERT(!s_messageLoopInterruptor);
|
| - s_messageLoopInterruptor = new MessageLoopInterruptor(currentThread);
|
| - ThreadState::current()->addInterruptor(s_messageLoopInterruptor);
|
| + OwnPtr<MessageLoopInterruptor> interruptor = adoptPtr(new MessageLoopInterruptor(currentThread));
|
| + ThreadState::current()->addInterruptor(interruptor.release());
|
| }
|
|
|
| DEFINE_STATIC_LOCAL(ModulesInitializer, initializer, ());
|
| @@ -208,19 +205,11 @@ void shutdown()
|
| s_endOfTaskRunner = 0;
|
| }
|
|
|
| - ASSERT(s_isolateInterruptor);
|
| - ThreadState::current()->removeInterruptor(s_isolateInterruptor);
|
| -
|
| // currentThread() is null if we are running on a thread without a message loop.
|
| if (Platform::current()->currentThread()) {
|
| ASSERT(s_pendingGCRunner);
|
| delete s_pendingGCRunner;
|
| s_pendingGCRunner = 0;
|
| -
|
| - ASSERT(s_messageLoopInterruptor);
|
| - ThreadState::current()->removeInterruptor(s_messageLoopInterruptor);
|
| - delete s_messageLoopInterruptor;
|
| - s_messageLoopInterruptor = 0;
|
| }
|
|
|
| // Shutdown V8-related background threads before V8 is ramped down. Note
|
|
|