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 29 matching lines...) Expand all Loading... |
40 #if ENABLE(ASSERT) | 40 #if ENABLE(ASSERT) |
41 , m_suspended(false) | 41 , m_suspended(false) |
42 #endif | 42 #endif |
43 { | 43 { |
44 } | 44 } |
45 | 45 |
46 SuspendableTimer::~SuspendableTimer() | 46 SuspendableTimer::~SuspendableTimer() |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 bool SuspendableTimer::hasPendingActivity() const | |
51 { | |
52 return isActive(); | |
53 } | |
54 | |
55 void SuspendableTimer::stop() | 50 void SuspendableTimer::stop() |
56 { | 51 { |
57 m_nextFireInterval = kNextFireIntervalInvalid; | 52 m_nextFireInterval = kNextFireIntervalInvalid; |
58 TimerBase::stop(); | 53 TimerBase::stop(); |
59 } | 54 } |
60 | 55 |
61 void SuspendableTimer::suspend() | 56 void SuspendableTimer::suspend() |
62 { | 57 { |
63 #if ENABLE(ASSERT) | 58 #if ENABLE(ASSERT) |
64 ASSERT(!m_suspended); | 59 ASSERT(!m_suspended); |
(...skipping 15 matching lines...) Expand all Loading... |
80 #endif | 75 #endif |
81 if (m_nextFireInterval >= 0.0) { | 76 if (m_nextFireInterval >= 0.0) { |
82 // start() was called before, therefore location() is already set. | 77 // start() was called before, therefore location() is already set. |
83 // m_nextFireInterval is only set in suspend() if the Timer was active. | 78 // m_nextFireInterval is only set in suspend() if the Timer was active. |
84 start(m_nextFireInterval, m_repeatInterval, location()); | 79 start(m_nextFireInterval, m_repeatInterval, location()); |
85 m_nextFireInterval = kNextFireIntervalInvalid; | 80 m_nextFireInterval = kNextFireIntervalInvalid; |
86 } | 81 } |
87 } | 82 } |
88 | 83 |
89 } // namespace blink | 84 } // namespace blink |
OLD | NEW |