summaryrefslogtreecommitdiffstats
path: root/components/copresence/handlers/audio/tick_clock_ref_counted.h
blob: 5bece752faaff08ae7b0fed869a312c80153b318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// 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 "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 TickClockRefCounted
    : public base::RefCountedThreadSafe<TickClockRefCounted> {
 public:
  explicit TickClockRefCounted(scoped_ptr<base::TickClock> clock);
  base::TimeTicks NowTicks();

 private:
  friend class base::RefCountedThreadSafe<TickClockRefCounted>;
  virtual ~TickClockRefCounted();

  scoped_ptr<base::TickClock> clock_;

  DISALLOW_COPY_AND_ASSIGN(TickClockRefCounted);
};

}  // namespace copresence

#endif  // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_