| 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 19 matching lines...) Expand all Loading... |
| 30 #include "platform/PlatformThreadData.h" | 30 #include "platform/PlatformThreadData.h" |
| 31 #include "platform/ThreadTimers.h" | 31 #include "platform/ThreadTimers.h" |
| 32 #include "wtf/CurrentTime.h" | 32 #include "wtf/CurrentTime.h" |
| 33 #include "wtf/HashSet.h" | 33 #include "wtf/HashSet.h" |
| 34 #include <limits.h> | 34 #include <limits.h> |
| 35 #include <math.h> | 35 #include <math.h> |
| 36 #include <limits> | 36 #include <limits> |
| 37 | 37 |
| 38 using namespace std; | 38 using namespace std; |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace blink { |
| 41 | 41 |
| 42 class TimerHeapReference; | 42 class TimerHeapReference; |
| 43 | 43 |
| 44 // Timers are stored in a heap data structure, used to implement a priority queu
e. | 44 // Timers are stored in a heap data structure, used to implement a priority queu
e. |
| 45 // This allows us to efficiently determine which timer needs to fire the soonest
. | 45 // This allows us to efficiently determine which timer needs to fire the soonest
. |
| 46 // Then we set a single shared system timer to fire at that time. | 46 // Then we set a single shared system timer to fire at that time. |
| 47 // | 47 // |
| 48 // When a timer's "next fire time" changes, we need to move it around in the pri
ority queue. | 48 // When a timer's "next fire time" changes, we need to move it around in the pri
ority queue. |
| 49 static Vector<TimerBase*>& threadGlobalTimerHeap() | 49 static Vector<TimerBase*>& threadGlobalTimerHeap() |
| 50 { | 50 { |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 { | 405 { |
| 406 setNextFireTime(m_unalignedNextFireTime); | 406 setNextFireTime(m_unalignedNextFireTime); |
| 407 } | 407 } |
| 408 | 408 |
| 409 double TimerBase::nextUnalignedFireInterval() const | 409 double TimerBase::nextUnalignedFireInterval() const |
| 410 { | 410 { |
| 411 ASSERT(isActive()); | 411 ASSERT(isActive()); |
| 412 return max(m_unalignedNextFireTime - monotonicallyIncreasingTime(), 0.0); | 412 return max(m_unalignedNextFireTime - monotonicallyIncreasingTime(), 0.0); |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace WebCore | 415 } // namespace blink |
| 416 | 416 |
| OLD | NEW |