Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 27 matching lines...) Expand all Loading... | |
| 38 | 38 |
| 39 class TimerHeapElement; | 39 class TimerHeapElement; |
| 40 | 40 |
| 41 class PLATFORM_EXPORT TimerBase { | 41 class PLATFORM_EXPORT TimerBase { |
| 42 WTF_MAKE_NONCOPYABLE(TimerBase); WTF_MAKE_FAST_ALLOCATED; | 42 WTF_MAKE_NONCOPYABLE(TimerBase); WTF_MAKE_FAST_ALLOCATED; |
| 43 public: | 43 public: |
| 44 TimerBase(); | 44 TimerBase(); |
| 45 virtual ~TimerBase(); | 45 virtual ~TimerBase(); |
| 46 | 46 |
| 47 void start(double nextFireInterval, double repeatInterval, const TraceLocati on&); | 47 void start(double nextFireInterval, double repeatInterval, const TraceLocati on&); |
| 48 void startExact(double nextFireInterval, double repeatInterval, const TraceL ocation& caller); | |
|
Daniel Bratell
2014/05/09 13:54:45
As a user of this API I would wonder about the dif
| |
| 48 | 49 |
| 49 void startRepeating(double repeatInterval, const TraceLocation& caller) | 50 void startRepeating(double repeatInterval, const TraceLocation& caller) |
| 50 { | 51 { |
| 51 start(repeatInterval, repeatInterval, caller); | 52 start(repeatInterval, repeatInterval, caller); |
| 52 } | 53 } |
| 53 void startOneShot(double interval, const TraceLocation& caller) | 54 void startOneShot(double interval, const TraceLocation& caller) |
| 54 { | 55 { |
| 55 start(interval, 0, caller); | 56 start(interval, 0, caller); |
| 56 } | 57 } |
| 58 void startOneShotExact(double next, const TraceLocation& caller) | |
| 59 { | |
| 60 startExact(next, 0, caller); | |
| 61 } | |
| 57 | 62 |
| 58 void stop(); | 63 void stop(); |
| 59 bool isActive() const; | 64 bool isActive() const; |
| 60 const TraceLocation& location() const { return m_location; } | 65 const TraceLocation& location() const { return m_location; } |
| 61 | 66 |
| 62 double nextFireInterval() const; | 67 double nextFireInterval() const; |
| 63 double nextUnalignedFireInterval() const; | 68 double nextUnalignedFireInterval() const; |
| 64 double repeatInterval() const { return m_repeatInterval; } | 69 double repeatInterval() const { return m_repeatInterval; } |
| 65 | 70 |
| 66 void augmentRepeatInterval(double delta) { | 71 void augmentRepeatInterval(double delta) { |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 TimerFiredClass* m_object; | 191 TimerFiredClass* m_object; |
| 187 TimerFiredFunction m_function; | 192 TimerFiredFunction m_function; |
| 188 | 193 |
| 189 double m_delay; | 194 double m_delay; |
| 190 bool m_shouldRestartWhenTimerFires; | 195 bool m_shouldRestartWhenTimerFires; |
| 191 }; | 196 }; |
| 192 | 197 |
| 193 } | 198 } |
| 194 | 199 |
| 195 #endif | 200 #endif |
| OLD | NEW |