OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/dom/TaskRunnerHelper.h" | 29 #include "core/dom/TaskRunnerHelper.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 namespace { | 33 namespace { |
34 // The lowest value returned by TimerBase::nextUnalignedFireInterval is 0.0 | 34 // The lowest value returned by TimerBase::nextUnalignedFireInterval is 0.0 |
35 const double kNextFireIntervalInvalid = -1.0; | 35 const double kNextFireIntervalInvalid = -1.0; |
36 } | 36 } |
37 | 37 |
38 SuspendableTimer::SuspendableTimer(ExecutionContext* context) | 38 SuspendableTimer::SuspendableTimer(ExecutionContext* context, TaskType taskType) |
39 : TimerBase(TaskRunnerHelper::get(TaskType::Timer, context)), | 39 : TimerBase(TaskRunnerHelper::get(taskType, context)), |
40 ActiveDOMObject(context), | 40 ActiveDOMObject(context), |
41 m_nextFireInterval(kNextFireIntervalInvalid), | 41 m_nextFireInterval(kNextFireIntervalInvalid), |
42 m_repeatInterval(0) | 42 m_repeatInterval(0) |
43 #if ENABLE(ASSERT) | 43 #if ENABLE(ASSERT) |
44 , | 44 , |
45 m_suspended(false) | 45 m_suspended(false) |
46 #endif | 46 #endif |
47 { | 47 { |
48 DCHECK(context); | 48 DCHECK(context); |
49 } | 49 } |
(...skipping 29 matching lines...) Expand all Loading... |
79 #endif | 79 #endif |
80 if (m_nextFireInterval >= 0.0) { | 80 if (m_nextFireInterval >= 0.0) { |
81 // start() was called before, therefore location() is already set. | 81 // start() was called before, therefore location() is already set. |
82 // m_nextFireInterval is only set in suspend() if the Timer was active. | 82 // m_nextFireInterval is only set in suspend() if the Timer was active. |
83 start(m_nextFireInterval, m_repeatInterval, location()); | 83 start(m_nextFireInterval, m_repeatInterval, location()); |
84 m_nextFireInterval = kNextFireIntervalInvalid; | 84 m_nextFireInterval = kNextFireIntervalInvalid; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
OLD | NEW |