Index: Source/web/SuspendableScriptExecutor.cpp |
diff --git a/Source/web/SuspendableScriptExecutor.cpp b/Source/web/SuspendableScriptExecutor.cpp |
index e4c95204d52448eacffdd18898ec0959bce89fa5..6dcd522e18e7506e08d422371a3844614fb6f27b 100644 |
--- a/Source/web/SuspendableScriptExecutor.cpp |
+++ b/Source/web/SuspendableScriptExecutor.cpp |
@@ -18,7 +18,9 @@ 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)); |
+#if !ENABLE(OILPAN) |
haraken
2015/06/23 08:12:01
In Oilpan, who keeps the SuspendableScriptExecutor
sof
2015/06/23 09:17:31
Done.
|
executor->ref(); |
+#endif |
executor->run(); |
} |
@@ -28,7 +30,7 @@ void SuspendableScriptExecutor::contextDestroyed() |
// and context remained suspend (method resume has never called) |
SuspendableTimer::contextDestroyed(); |
m_callback->completed(Vector<v8::Local<v8::Value>>()); |
- deref(); |
+ dispose(); |
} |
SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worldID, const WillBeHeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback) |
@@ -81,7 +83,17 @@ void SuspendableScriptExecutor::executeAndDestroySelf() |
results.append(scriptValue); |
} |
m_callback->completed(results); |
+ dispose(); |
+} |
+ |
+void SuspendableScriptExecutor::dispose() |
+{ |
+#if ENABLE(OILPAN) |
+ // Remove object as a ContextLifecycleObserver. |
+ ActiveDOMObject::clearContext(); |
+#else |
deref(); |
+#endif |
} |
DEFINE_TRACE(SuspendableScriptExecutor) |