Extension syncing: Introduce a NeedsSync pref
[chromium-blink-merge.git] / components / copresence / handlers / audio / tick_clock_ref_counted.h
blobc461432feb0eb9a5db013d0cf90d5793ce1732f0
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"
12 namespace base {
13 class TickClock;
14 class TimeTicks;
17 namespace copresence {
19 class TickClockRefCounted
20 : public base::RefCountedThreadSafe<TickClockRefCounted> {
21 public:
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;
29 private:
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_