OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include <algorithm> | 36 #include <algorithm> |
37 #include <limits.h> | 37 #include <limits.h> |
38 #include <limits> | 38 #include <limits> |
39 #include <math.h> | 39 #include <math.h> |
40 | 40 |
41 namespace blink { | 41 namespace blink { |
42 | 42 |
43 TimerBase::TimerBase(WebTaskRunner* webTaskRunner) | 43 TimerBase::TimerBase(WebTaskRunner* webTaskRunner) |
44 : m_nextFireTime(0), | 44 : m_nextFireTime(0), |
45 m_repeatInterval(0), | 45 m_repeatInterval(0), |
46 m_webTaskRunner(webTaskRunner->clone()) | 46 m_webTaskRunner(webTaskRunner->clone()), |
47 #if DCHECK_IS_ON() | 47 #if DCHECK_IS_ON() |
48 , | 48 m_thread(currentThread()), |
49 m_thread(currentThread()) | |
50 #endif | 49 #endif |
51 , | |
52 m_weakPtrFactory(this) { | 50 m_weakPtrFactory(this) { |
53 ASSERT(m_webTaskRunner); | 51 ASSERT(m_webTaskRunner); |
54 } | 52 } |
55 | 53 |
56 TimerBase::~TimerBase() { | 54 TimerBase::~TimerBase() { |
57 stop(); | 55 stop(); |
58 } | 56 } |
59 | 57 |
60 void TimerBase::start(double nextFireInterval, | 58 void TimerBase::start(double nextFireInterval, |
61 double repeatInterval, | 59 double repeatInterval, |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 const TimerBase* b) const { | 149 const TimerBase* b) const { |
152 return a->m_nextFireTime < b->m_nextFireTime; | 150 return a->m_nextFireTime < b->m_nextFireTime; |
153 } | 151 } |
154 | 152 |
155 // static | 153 // static |
156 double TimerBase::timerMonotonicallyIncreasingTime() const { | 154 double TimerBase::timerMonotonicallyIncreasingTime() const { |
157 return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds(); | 155 return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds(); |
158 } | 156 } |
159 | 157 |
160 } // namespace blink | 158 } // namespace blink |
OLD | NEW |