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

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimer.cpp

Issue 2366253002: Remove ActiveDOMObject::stop() (Closed)
Patch Set: temp Created 4 years, 2 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
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();
}

Powered by Google App Engine
This is Rietveld 408576698