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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp

Issue 2552673002: Eagerly dispose of ScheduledActions (reland.) (Closed)
Patch Set: Add assert Created 4 years 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
Index: third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp b/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp
index 403c3d14ba72dfbed30bcb54ea92f4982612322a..f0c1db8d9b36888368e3114af066449d64f0a572 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScheduledAction.cpp
@@ -61,7 +61,17 @@ DEFINE_TRACE(ScheduledAction) {
visitor->trace(m_code);
}
-ScheduledAction::~ScheduledAction() {}
+ScheduledAction::~ScheduledAction() {
+ // Verify that owning DOMTimer has eagerly disposed.
+ DCHECK(m_info.IsEmpty());
+}
+
+void ScheduledAction::dispose() {
+ m_code.dispose();
+ m_info.Clear();
+ m_function.clear();
+ m_scriptState.clear();
+}
void ScheduledAction::execute(ExecutionContext* context) {
if (context->isDocument()) {

Powered by Google App Engine
This is Rietveld 408576698