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

Unified Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 19494002: Distinguish actions registered with setTimeout() and setInterval(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index 2321ebf94dbbea6604e0d30d10c17966b55123a3..aa23e9aee1f26e1ba352c64fd98643ef19f23413 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -181,12 +181,12 @@ void WorkerGlobalScope::postTask(PassOwnPtr<Task> task)
int WorkerGlobalScope::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(scriptExecutionContext(), action, timeout, true);
+ return DOMTimer::install(scriptExecutionContext(), DOMTimer::TimerTypeTimeout, action, timeout);
}
void WorkerGlobalScope::clearTimeout(int timeoutID)
{
- DOMTimer::removeByID(scriptExecutionContext(), timeoutID);
+ DOMTimer::removeByIDIfTypeMatches(scriptExecutionContext(), DOMTimer::TimerTypeTimeout, timeoutID);
}
void WorkerGlobalScope::clearInspector()
@@ -196,12 +196,12 @@ void WorkerGlobalScope::clearInspector()
int WorkerGlobalScope::setInterval(PassOwnPtr<ScheduledAction> action, int timeout)
{
- return DOMTimer::install(scriptExecutionContext(), action, timeout, false);
+ return DOMTimer::install(scriptExecutionContext(), DOMTimer::TimerTypeInterval, action, timeout);
}
void WorkerGlobalScope::clearInterval(int timeoutID)
{
- DOMTimer::removeByID(scriptExecutionContext(), timeoutID);
+ DOMTimer::removeByIDIfTypeMatches(scriptExecutionContext(), DOMTimer::TimerTypeInterval, timeoutID);
}
void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionCode& ec)

Powered by Google App Engine
This is Rietveld 408576698