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

Unified Diff: Source/web/SuspendableScriptExecutor.cpp

Issue 1197163003: Oilpan: make SuspendableScriptExecutor safe. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: re-intro RefCountedGarbageCollected 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..03459c6a33b858e7a74a1e5944ac0ba5ff88cf81 100644
--- a/Source/web/SuspendableScriptExecutor.cpp
+++ b/Source/web/SuspendableScriptExecutor.cpp
@@ -28,7 +28,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,6 +81,15 @@ void SuspendableScriptExecutor::executeAndDestroySelf()
results.append(scriptValue);
}
m_callback->completed(results);
+ dispose();
+}
+
+void SuspendableScriptExecutor::dispose()
+{
+#if ENABLE(OILPAN)
+ // Remove object as a ContextLifecycleObserver.
+ ActiveDOMObject::clearContext();
haraken 2015/06/23 09:25:56 Is this a performance optimization? Or do we need
sof 2015/06/23 09:40:59 I think it makes sense to remove oneself here, rat
haraken 2015/06/23 09:44:55 Makes sense. (I'd prefer calling ActiveDOMObject::
+#endif
deref();
}
« 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