Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: Source/platform/TimerHeapEntry.cpp

Issue 959263002: WIP - not ready for review (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Decouple TimerHeap and ThreadTimers. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/TimerHeapEntry.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/TimerHeapEntry.cpp
diff --git a/Source/platform/TimerHeapEntry.cpp b/Source/platform/TimerHeapEntry.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..728aebbb9de0772ab527ecea664f34ed757fceeb
--- /dev/null
+++ b/Source/platform/TimerHeapEntry.cpp
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/TimerHeapEntry.h"
+
+#include "platform/Timer.h"
+#include "platform/TimerHeap.h"
+#include <limits>
+
+namespace blink {
+
+TimerHeapEntry::TimerHeapEntry(TimerHeap* owner)
+ : m_owner(owner)
+ , m_state(TimerHeapEntryNotInHeap)
+ , m_value(0)
+ , m_heapIndex(std::numeric_limits<std::size_t>::max())
+{
+ ASSERT(m_owner);
+}
+
+TimerHeapEntry::~TimerHeapEntry()
+{
+}
+
+void TimerHeapEntry::setValue(TimerBase& timer, double newValue)
+{
+ ASSERT(&timer.heapEntry() == this);
+
+ double oldValue = m_value;
+ m_value = newValue;
+ m_owner->didChangeValue(timer, oldValue);
+}
+
+} // namespace blink
« no previous file with comments | « Source/platform/TimerHeapEntry.h ('k') | Source/platform/blink_platform.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698