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

Unified Diff: base/time/tick_clock.h

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 2 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 | « base/time/default_tick_clock.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time/tick_clock.h
diff --git a/base/time/tick_clock.h b/base/time/tick_clock.h
index 3e53d832857eefb46d708892ce3cb7cc170221a4..f0510b0cc5a0603420666a51568c2c0023c4265c 100644
--- a/base/time/tick_clock.h
+++ b/base/time/tick_clock.h
@@ -6,6 +6,7 @@
#define BASE_TICK_CLOCK_H_
#include "base/base_export.h"
+#include "base/memory/ref_counted.h"
#include "base/time/time.h"
namespace base {
@@ -24,15 +25,17 @@ namespace base {
// simple test implementation.
//
// See Clock (base/time/clock.h) for the equivalent interface for Times.
-class BASE_EXPORT TickClock {
+class BASE_EXPORT TickClock : public RefCounted<TickClock> {
public:
- virtual ~TickClock();
-
// NowTicks() must be safe to call from any thread. The caller may
// assume that NowTicks() is monotonic (but not strictly monotonic).
// In other words, the returned TimeTicks will never decrease with
// time, although they might "stand still".
virtual TimeTicks NowTicks() = 0;
+
+ protected:
+ friend class base::RefCounted<TickClock>;
+ virtual ~TickClock();
};
} // namespace base
« no previous file with comments | « base/time/default_tick_clock.h ('k') | chrome/browser/browser_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698