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

Unified Diff: base/default_tick_clock.cc

Issue 11607003: Add a Clock and TickClock interface for mocking out time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
Index: base/default_tick_clock.cc
diff --git a/base/default_tick_clock.cc b/base/default_tick_clock.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dc54a7c9bc723cdf52ce281304e6b08fc3f4304a
--- /dev/null
+++ b/base/default_tick_clock.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 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 "base/default_tick_clock.h"
+#include "base/lazy_instance.h"
+
+namespace base {
+
+namespace {
+
+LazyInstance<DefaultTickClock> default_tick_clock = LAZY_INSTANCE_INITIALIZER;
Ryan Sleevi 2012/12/17 19:54:46 DESIGN: Same here
akalin 2012/12/17 22:38:31 also removed this
+
+} // namespace
+
+DefaultTickClock::~DefaultTickClock() {}
+
+TimeTicks DefaultTickClock::NowTicks() {
+ return TimeTicks::Now();
+}
+
+// static
+DefaultTickClock* DefaultTickClock::Get() {
+ return default_tick_clock.Pointer();
+}
+
+} // namespace base

Powered by Google App Engine
This is Rietveld 408576698