OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 m_runWhenResumed = false; | 103 m_runWhenResumed = false; |
104 m_suspended = false; | 104 m_suspended = false; |
105 return; | 105 return; |
106 } | 106 } |
107 | 107 |
108 ASSERT(!m_runWhenResumed); | 108 ASSERT(!m_runWhenResumed); |
109 if (m_timer.isActive()) | 109 if (m_timer.isActive()) |
110 m_timer.stop(); | 110 m_timer.stop(); |
111 } | 111 } |
112 | 112 |
| 113 bool isActive() const |
| 114 { |
| 115 return m_timer.isActive(); |
| 116 } |
| 117 |
113 private: | 118 private: |
114 void fired(Timer<AsyncMethodRunner<TargetClass> >*) { (m_object->*m_method)(
); } | 119 void fired(Timer<AsyncMethodRunner<TargetClass> >*) { (m_object->*m_method)(
); } |
115 | 120 |
116 Timer<AsyncMethodRunner<TargetClass> > m_timer; | 121 Timer<AsyncMethodRunner<TargetClass> > m_timer; |
117 | 122 |
118 TargetClass* m_object; | 123 TargetClass* m_object; |
119 TargetMethod m_method; | 124 TargetMethod m_method; |
120 | 125 |
121 bool m_suspended; | 126 bool m_suspended; |
122 bool m_runWhenResumed; | 127 bool m_runWhenResumed; |
123 }; | 128 }; |
124 | 129 |
125 } | 130 } |
126 | 131 |
127 #endif | 132 #endif |
OLD | NEW |