| Index: Source/web/SuspendableScriptExecutor.cpp
|
| diff --git a/Source/web/SuspendableScriptExecutor.cpp b/Source/web/SuspendableScriptExecutor.cpp
|
| index aff6d72149ea7d5b9d3cdddc53f3e3c255fa695b..2c265b0da35eb6a720061b6e1ad6c06c3c3a462b 100644
|
| --- a/Source/web/SuspendableScriptExecutor.cpp
|
| +++ b/Source/web/SuspendableScriptExecutor.cpp
|
| @@ -17,8 +17,8 @@ namespace blink {
|
|
|
| void SuspendableScriptExecutor::createAndRun(LocalFrame* frame, int worldID, const WillBeHeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback)
|
| {
|
| - RefPtrWillBeRawPtr<SuspendableScriptExecutor> executor = adoptRefWillBeNoop(new SuspendableScriptExecutor(frame, worldID, sources, extensionGroup, userGesture, callback));
|
| - executor->ref();
|
| + SuspendableScriptExecutor* executor = new SuspendableScriptExecutor(frame, worldID, sources, extensionGroup, userGesture, callback);
|
| + executor->m_keepAlive = executor;
|
| executor->run();
|
| }
|
|
|
| @@ -32,11 +32,11 @@ void SuspendableScriptExecutor::contextDestroyed()
|
| SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worldID, const WillBeHeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback)
|
| : SuspendableTimer(frame->document())
|
| , m_frame(frame)
|
| - , m_worldID(worldID)
|
| , m_sources(sources)
|
| + , m_callback(callback)
|
| + , m_worldID(worldID)
|
| , m_extensionGroup(extensionGroup)
|
| , m_userGesture(userGesture)
|
| - , m_callback(callback)
|
| #if ENABLE(ASSERT)
|
| , m_disposed(false)
|
| #endif
|
| @@ -45,9 +45,7 @@ SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worl
|
|
|
| SuspendableScriptExecutor::~SuspendableScriptExecutor()
|
| {
|
| -#if ENABLE(ASSERT)
|
| ASSERT(m_disposed);
|
| -#endif
|
| }
|
|
|
| void SuspendableScriptExecutor::fired()
|
| @@ -70,9 +68,6 @@ void SuspendableScriptExecutor::run()
|
|
|
| void SuspendableScriptExecutor::executeAndDestroySelf()
|
| {
|
| - // Ensure that this object is not deleted even if the context is destroyed.
|
| - RefPtrWillBeRawPtr<SuspendableScriptExecutor> protect(this);
|
| -
|
| // after calling the destructor of object - object will be unsubscribed from
|
| // resumed and contextDestroyed LifecycleObserver methods
|
| OwnPtr<UserGestureIndicator> indicator;
|
| @@ -103,19 +98,16 @@ void SuspendableScriptExecutor::dispose()
|
| m_disposed = true;
|
| #endif
|
|
|
| -#if ENABLE(OILPAN)
|
| // Remove object as a ContextLifecycleObserver.
|
| ActiveDOMObject::clearContext();
|
| -#endif
|
| - deref();
|
| + m_keepAlive.clear();
|
| + stop();
|
| }
|
|
|
| DEFINE_TRACE(SuspendableScriptExecutor)
|
| {
|
| -#if ENABLE(OILPAN)
|
| visitor->trace(m_frame);
|
| visitor->trace(m_sources);
|
| -#endif
|
| SuspendableTimer::trace(visitor);
|
| }
|
|
|
|
|