Index: base/default_clock.cc |
diff --git a/base/default_clock.cc b/base/default_clock.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a2c20cd1100834777790bd5c89fa54888681f201 |
--- /dev/null |
+++ b/base/default_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_clock.h" |
+#include "base/lazy_instance.h" |
+ |
+namespace base { |
+ |
+namespace { |
+ |
+LazyInstance<DefaultClock> default_clock = LAZY_INSTANCE_INITIALIZER; |
Ryan Sleevi
2012/12/17 19:54:46
DESIGN: Should this be Leaky, to match the worker-
awong
2012/12/17 19:55:11
nit: g_default_clock
akalin
2012/12/17 22:38:31
Brett didn't like the lazy instance, so I removed
akalin
2012/12/17 22:38:31
removed lazy instance
|
+ |
+} // namespace |
+ |
+DefaultClock::~DefaultClock() {} |
+ |
+Time DefaultClock::Now() { |
+ return Time::Now(); |
+} |
+ |
+// static |
+DefaultClock* DefaultClock::Get() { |
+ return default_clock.Pointer(); |
+} |
+ |
+} // namespace base |