1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
17 namespace copresence
{
19 class TickClockRefCounted
20 : public base::RefCountedThreadSafe
<TickClockRefCounted
> {
22 explicit TickClockRefCounted(scoped_ptr
<base::TickClock
> clock
);
24 // Takes ownership of the clock.
25 explicit TickClockRefCounted(base::TickClock
* clock
);
27 base::TimeTicks
NowTicks() const;
30 friend class base::RefCountedThreadSafe
<TickClockRefCounted
>;
31 virtual ~TickClockRefCounted();
33 scoped_ptr
<base::TickClock
> clock_
;
35 DISALLOW_COPY_AND_ASSIGN(TickClockRefCounted
);
38 } // namespace copresence
40 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_