OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DOMTimerCoordinator_h | 5 #ifndef DOMTimerCoordinator_h |
6 #define DOMTimerCoordinator_h | 6 #define DOMTimerCoordinator_h |
7 | 7 |
8 #include "platform/heap/Handle.h" | 8 #include "platform/heap/Handle.h" |
9 #include "wtf/Noncopyable.h" | 9 #include "wtf/Noncopyable.h" |
10 #include "wtf/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 DISALLOW_NEW(); | 25 DISALLOW_NEW(); |
26 WTF_MAKE_NONCOPYABLE(DOMTimerCoordinator); | 26 WTF_MAKE_NONCOPYABLE(DOMTimerCoordinator); |
27 public: | 27 public: |
28 explicit DOMTimerCoordinator(PassOwnPtr<WebTaskRunner>); | 28 explicit DOMTimerCoordinator(PassOwnPtr<WebTaskRunner>); |
29 | 29 |
30 // Creates and installs a new timer. Returns the assigned ID. | 30 // Creates and installs a new timer. Returns the assigned ID. |
31 int installNewTimeout(ExecutionContext*, ScheduledAction*, int timeout, bool
singleShot); | 31 int installNewTimeout(ExecutionContext*, ScheduledAction*, int timeout, bool
singleShot); |
32 | 32 |
33 // Removes and disposes the timer with the specified ID, if any. This may | 33 // Removes and disposes the timer with the specified ID, if any. This may |
34 // destroy the timer. | 34 // destroy the timer. |
35 void removeTimeoutByID(int id); | 35 DOMTimer* removeTimeoutByID(int id); |
36 | 36 |
37 // Timers created during the execution of other timers, and | 37 // Timers created during the execution of other timers, and |
38 // repeating timers, are throttled. Timer nesting level tracks the | 38 // repeating timers, are throttled. Timer nesting level tracks the |
39 // number of linked timers or repetitions of a timer. See | 39 // number of linked timers or repetitions of a timer. See |
40 // https://html.spec.whatwg.org/#timers | 40 // https://html.spec.whatwg.org/#timers |
41 int timerNestingLevel() { return m_timerNestingLevel; } | 41 int timerNestingLevel() { return m_timerNestingLevel; } |
42 | 42 |
43 // Sets the timer nesting level. Set when a timer executes so that | 43 // Sets the timer nesting level. Set when a timer executes so that |
44 // any timers created while the timer is executing will incur a | 44 // any timers created while the timer is executing will incur a |
45 // deeper timer nesting level, see DOMTimer::DOMTimer. | 45 // deeper timer nesting level, see DOMTimer::DOMTimer. |
(...skipping 12 matching lines...) Expand all Loading... |
58 TimeoutMap m_timers; | 58 TimeoutMap m_timers; |
59 | 59 |
60 int m_circularSequentialID; | 60 int m_circularSequentialID; |
61 int m_timerNestingLevel; | 61 int m_timerNestingLevel; |
62 OwnPtr<WebTaskRunner> m_timerTaskRunner; | 62 OwnPtr<WebTaskRunner> m_timerTaskRunner; |
63 }; | 63 }; |
64 | 64 |
65 } // namespace blink | 65 } // namespace blink |
66 | 66 |
67 #endif // DOMTimerCoordinator_h | 67 #endif // DOMTimerCoordinator_h |
OLD | NEW |