Index: components/copresence/handlers/audio/tick_clock_ref_counted.h |
diff --git a/components/copresence/handlers/audio/tick_clock_ref_counted.h b/components/copresence/handlers/audio/tick_clock_ref_counted.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..833228f2ed4fb4622b7930382440283d553255d6 |
--- /dev/null |
+++ b/components/copresence/handlers/audio/tick_clock_ref_counted.h |
@@ -0,0 +1,38 @@ |
+// Copyright 2014 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. |
+ |
+#ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ |
+#define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ |
+ |
+#include <string> |
+#include <vector> |
xiyuan
2014/10/21 21:08:12
nit: both headers seems not used.
rkc
2014/10/22 00:16:57
Done.
|
+ |
+#include "base/callback.h" |
xiyuan
2014/10/21 21:08:12
nit: not used?
rkc
2014/10/22 00:16:57
Done.
|
+#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/time/time.h" |
+ |
+namespace base { |
+class TickClock; |
+} |
+ |
+namespace copresence { |
+ |
+class BASE_EXPORT TickClockRefCounted |
xiyuan
2014/10/21 21:08:12
Is BASE_EXPORT intentional here?
rkc
2014/10/22 00:16:57
Leftover from copying this code from base/timer :)
|
+ : public base::RefCountedThreadSafe<TickClockRefCounted> { |
+ public: |
+ explicit TickClockRefCounted(base::TickClock* clock); |
xiyuan
2014/10/21 21:08:12
nit: Document ownership or use scoped_ptr<>
rkc
2014/10/22 00:16:57
Makes the test code a bit uglier :)
Done.
|
+ base::TimeTicks NowTicks(); |
+ |
+ private: |
+ friend class RefCountedThreadSafe<TickClockRefCounted>; |
+ virtual ~TickClockRefCounted(); |
+ |
+ scoped_ptr<base::TickClock> clock_; |
+}; |
xiyuan
2014/10/21 21:08:12
nit: DISALLOW_COPY_AND_ASSIGN?
rkc
2014/10/22 00:16:57
Done.
|
+ |
+} // namespace copresence |
+ |
+#endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ |