summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/page/DOMTimer.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page/DOMTimer.h')
-rw-r--r--Source/WebCore/page/DOMTimer.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/WebCore/page/DOMTimer.h b/Source/WebCore/page/DOMTimer.h
index 4fc6aae..ba260e0 100644
--- a/Source/WebCore/page/DOMTimer.h
+++ b/Source/WebCore/page/DOMTimer.h
@@ -34,7 +34,10 @@
namespace WebCore {
+ class Settings;
+
class DOMTimer : public SuspendableTimer {
+ friend class Settings;
public:
virtual ~DOMTimer();
// Creates a new timer owned by specified ScriptExecutionContext, starts it
@@ -46,18 +49,27 @@ namespace WebCore {
virtual void contextDestroyed();
virtual void stop();
- // The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
- static double minTimerInterval() { return s_minTimerInterval; }
- static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
+ // Adjust to a change in the ScriptExecutionContext's minimum timer interval.
+ // This allows the minimum allowable interval time to be changed in response
+ // to events like moving a tab to the background.
+ void adjustMinimumTimerInterval(double oldMinimumTimerInterval);
private:
DOMTimer(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot);
virtual void fired();
+ double intervalClampedToMinimum(int timeout, double minimumTimerInterval) const;
+
+ // The default minimum allowable timer setting (in seconds, 0.001 == 1 ms).
+ // These are only modified via static methods in Settings.
+ static double defaultMinTimerInterval() { return s_minDefaultTimerInterval; }
+ static void setDefaultMinTimerInterval(double value) { s_minDefaultTimerInterval = value; }
+
int m_timeoutId;
int m_nestingLevel;
OwnPtr<ScheduledAction> m_action;
- static double s_minTimerInterval;
+ int m_originalTimeout;
+ static double s_minDefaultTimerInterval;
};
} // namespace WebCore