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

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

Issue 1972663002: Eagerly remove disposed DOMTimers as observers upon completion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 7 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 | « third_party/WebKit/Source/core/frame/DOMTimerCoordinator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp b/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
index 064b701a006742560a71db1b5edd5c29212f9ec0..3f3460e64bae677e8ee565e425072b2cc7b4307a 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimerCoordinator.cpp
@@ -31,15 +31,16 @@ int DOMTimerCoordinator::installNewTimeout(ExecutionContext* context, ScheduledA
return timeoutID;
}
-void DOMTimerCoordinator::removeTimeoutByID(int timeoutID)
+DOMTimer* DOMTimerCoordinator::removeTimeoutByID(int timeoutID)
{
if (timeoutID <= 0)
- return;
+ return nullptr;
- if (DOMTimer* removedTimer = m_timers.get(timeoutID))
+ DOMTimer* removedTimer = m_timers.take(timeoutID);
+ if (removedTimer)
removedTimer->disposeTimer();
- m_timers.remove(timeoutID);
+ return removedTimer;
}
DEFINE_TRACE(DOMTimerCoordinator)
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimerCoordinator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698