Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp |
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp |
index 31701aec25db032c4b5bcffd0a658c0edb90e7cf..8d4c2c32e8e702519066d97f8da55f635d7075e5 100644 |
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp |
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp |
@@ -108,9 +108,17 @@ DOMTimer::DOMTimer(ExecutionContext* context, |
DOMTimer::~DOMTimer() {} |
-void DOMTimer::disposeTimer() { |
- m_action = nullptr; |
+void DOMTimer::stop() { |
+ InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this); |
m_userGestureToken = nullptr; |
+ // Need to release JS objects potentially protected by ScheduledAction |
+ // because they can form circular references back to the ExecutionContext |
+ // which will cause a memory leak. |
+ m_action = nullptr; |
+ SuspendableTimer::stop(); |
+} |
+ |
+void DOMTimer::contextDestroyed() { |
stop(); |
} |
@@ -162,15 +170,6 @@ void DOMTimer::fired() { |
clearContext(); |
} |
-void DOMTimer::stop() { |
- InspectorInstrumentation::asyncTaskCanceled(getExecutionContext(), this); |
- SuspendableTimer::stop(); |
- // Need to release JS objects potentially protected by ScheduledAction |
- // because they can form circular references back to the ExecutionContext |
- // which will cause a memory leak. |
- m_action.clear(); |
-} |
- |
WebTaskRunner* DOMTimer::timerTaskRunner() const { |
return getExecutionContext()->timers()->timerTaskRunner(); |
} |