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

Side by Side Diff: components/copresence/handlers/audio/tick_clock_ref_counted.h

Issue 690213004: Refactoring AudioDirectiveHandler to support testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ 5 #ifndef COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_
6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ 6 #define COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h"
12 11
13 namespace base { 12 namespace base {
14 class TickClock; 13 class TickClock;
14 class TimeTicks;
15 } 15 }
16 16
17 namespace copresence { 17 namespace copresence {
18 18
19 class TickClockRefCounted 19 class TickClockRefCounted
20 : public base::RefCountedThreadSafe<TickClockRefCounted> { 20 : public base::RefCountedThreadSafe<TickClockRefCounted> {
21 public: 21 public:
22 explicit TickClockRefCounted(scoped_ptr<base::TickClock> clock); 22 explicit TickClockRefCounted(scoped_ptr<base::TickClock> clock);
23 base::TimeTicks NowTicks(); 23
24 // Takes ownership of the clock.
25 explicit TickClockRefCounted(base::TickClock* clock);
26
27 base::TimeTicks NowTicks() const;
24 28
25 private: 29 private:
26 friend class base::RefCountedThreadSafe<TickClockRefCounted>; 30 friend class base::RefCountedThreadSafe<TickClockRefCounted>;
27 virtual ~TickClockRefCounted(); 31 virtual ~TickClockRefCounted();
28 32
29 scoped_ptr<base::TickClock> clock_; 33 scoped_ptr<base::TickClock> clock_;
30 34
31 DISALLOW_COPY_AND_ASSIGN(TickClockRefCounted); 35 DISALLOW_COPY_AND_ASSIGN(TickClockRefCounted);
32 }; 36 };
33 37
34 } // namespace copresence 38 } // namespace copresence
35 39
36 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_ 40 #endif // COMPONENTS_COPRESENCE_HANDLERS_AUDIO_TICK_CLOCK_REF_COUNTED_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698