OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "platform/TimerHeapEntry.h" |
| 7 |
| 8 #include "platform/Timer.h" |
| 9 #include "platform/TimerHeap.h" |
| 10 #include <limits> |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 TimerHeapEntry::TimerHeapEntry(TimerHeap* owner) |
| 15 : m_owner(owner) |
| 16 , m_state(TimerHeapEntryNotInHeap) |
| 17 , m_value(0) |
| 18 , m_heapIndex(std::numeric_limits<std::size_t>::max()) |
| 19 { |
| 20 ASSERT(m_owner); |
| 21 } |
| 22 |
| 23 TimerHeapEntry::~TimerHeapEntry() |
| 24 { |
| 25 } |
| 26 |
| 27 void TimerHeapEntry::setValue(TimerBase& timer, double newValue) |
| 28 { |
| 29 ASSERT(&timer.heapEntry() == this); |
| 30 |
| 31 double oldValue = m_value; |
| 32 m_value = newValue; |
| 33 m_owner->didChangeValue(timer, oldValue); |
| 34 } |
| 35 |
| 36 } // namespace blink |
OLD | NEW |