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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 TimerBase::stop(); | 59 TimerBase::stop(); |
60 } | 60 } |
61 | 61 |
62 void SuspendableTimer::suspend() | 62 void SuspendableTimer::suspend() |
63 { | 63 { |
64 #if ENABLE(ASSERT) | 64 #if ENABLE(ASSERT) |
65 ASSERT(!m_suspended); | 65 ASSERT(!m_suspended); |
66 m_suspended = true; | 66 m_suspended = true; |
67 #endif | 67 #endif |
68 if (isActive()) { | 68 if (isActive()) { |
69 m_nextFireInterval = nextUnalignedFireInterval(); | 69 m_nextFireInterval = nextFireInterval(); |
70 ASSERT(m_nextFireInterval >= 0.0); | 70 ASSERT(m_nextFireInterval >= 0.0); |
71 m_repeatInterval = repeatInterval(); | 71 m_repeatInterval = repeatInterval(); |
72 TimerBase::stop(); | 72 TimerBase::stop(); |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void SuspendableTimer::resume() | 76 void SuspendableTimer::resume() |
77 { | 77 { |
78 #if ENABLE(ASSERT) | 78 #if ENABLE(ASSERT) |
79 ASSERT(m_suspended); | 79 ASSERT(m_suspended); |
80 m_suspended = false; | 80 m_suspended = false; |
81 #endif | 81 #endif |
82 if (m_nextFireInterval >= 0.0) { | 82 if (m_nextFireInterval >= 0.0) { |
83 // start() was called before, therefore location() is already set. | 83 // start() was called before, therefore location() is already set. |
84 // m_nextFireInterval is only set in suspend() if the Timer was active. | 84 // m_nextFireInterval is only set in suspend() if the Timer was active. |
85 start(m_nextFireInterval, m_repeatInterval, location()); | 85 start(m_nextFireInterval, m_repeatInterval, location()); |
86 m_nextFireInterval = kNextFireIntervalInvalid; | 86 m_nextFireInterval = kNextFireIntervalInvalid; |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 } // namespace blink | 90 } // namespace blink |
OLD | NEW |