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

Unified Diff: Source/web/SuspendableScriptExecutor.cpp

Issue 1197163003: Oilpan: make SuspendableScriptExecutor safe. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/web/SuspendableScriptExecutor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/web/SuspendableScriptExecutor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698