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

Unified Diff: Source/core/page/DOMTimer.h

Issue 19494002: Distinguish actions registered with setTimeout() and setInterval(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again. 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
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/page/DOMTimer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/DOMTimer.h
diff --git a/Source/core/page/DOMTimer.h b/Source/core/page/DOMTimer.h
index 9324899960aea5b2ce0b8579a57208efbe698465..d0ca5c4ac1c2a6865f832bf1ac9fa11361a36151 100644
--- a/Source/core/page/DOMTimer.h
+++ b/Source/core/page/DOMTimer.h
@@ -40,13 +40,19 @@ class ScriptExecutionContext;
class DOMTimer : public SuspendableTimer {
public:
+ enum Type {
+ TimeoutType,
+ IntervalType
+ };
+
// Creates a new timer owned by the ScriptExecutionContext, starts it and returns its ID.
- static int install(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot);
- static void removeByID(ScriptExecutionContext*, int timeoutID);
+ static int install(ScriptExecutionContext*, Type, PassOwnPtr<ScheduledAction>, int timeout);
+ static void removeByIDIfTypeMatches(ScriptExecutionContext*, Type, int timeoutID);
virtual ~DOMTimer();
int timeoutID() const;
+ Type type() const;
// ActiveDOMObject
virtual void contextDestroyed() OVERRIDE;
@@ -60,17 +66,18 @@ private:
friend class ScriptExecutionContext; // For create().
// Should only be used by ScriptExecutionContext.
- static PassOwnPtr<DOMTimer> create(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot, int timeoutID)
+ static PassOwnPtr<DOMTimer> create(ScriptExecutionContext* context, Type type, PassOwnPtr<ScheduledAction> action, int timeout, int timeoutID)
{
- return adoptPtr(new DOMTimer(context, action, timeout, singleShot, timeoutID));
+ return adoptPtr(new DOMTimer(context, type, action, timeout, timeoutID));
}
- DOMTimer(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int interval, bool singleShot, int timeoutID);
- virtual void fired();
+ DOMTimer(ScriptExecutionContext*, Type, PassOwnPtr<ScheduledAction>, int interval, int timeoutID);
+ virtual void fired() OVERRIDE;
- // Retuns timer fire time rounded to the next multiple of timer alignment interval.
- virtual double alignedFireTime(double) const;
+ // Returns timer fire time rounded to the next multiple of timer alignment interval.
+ virtual double alignedFireTime(double) const OVERRIDE;
+ Type m_type;
int m_timeoutID;
int m_nestingLevel;
OwnPtr<ScheduledAction> m_action;
« no previous file with comments | « Source/core/dom/ScriptExecutionContext.cpp ('k') | Source/core/page/DOMTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698