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

Side by Side Diff: media/cast/test/skewed_tick_clock.h

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 2 months 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
« no previous file with comments | « media/cast/cast_environment.cc ('k') | media/filters/pipeline_integration_test_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H 5 #ifndef CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H
6 #define CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H 6 #define CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H
7 7
8 #include "base/time/tick_clock.h" 8 #include "base/time/tick_clock.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 10
(...skipping 10 matching lines...) Expand all
21 // |skew| > 1.0 means clock runs faster. 21 // |skew| > 1.0 means clock runs faster.
22 // |offset| > 0 means clock returns times from the future. 22 // |offset| > 0 means clock returns times from the future.
23 // Note, |offset| is cumulative. 23 // Note, |offset| is cumulative.
24 // Also note that changing the skew will never make the clock 24 // Also note that changing the skew will never make the clock
25 // jump forwards or backwards, only changing the offset will 25 // jump forwards or backwards, only changing the offset will
26 // do that. 26 // do that.
27 void SetSkew(double skew, base::TimeDelta offset); 27 void SetSkew(double skew, base::TimeDelta offset);
28 virtual base::TimeTicks NowTicks() override; 28 virtual base::TimeTicks NowTicks() override;
29 29
30 private: 30 private:
31 virtual ~SkewedTickClock() {}
32
31 base::TimeTicks SkewTicks(base::TimeTicks now); 33 base::TimeTicks SkewTicks(base::TimeTicks now);
32 base::TickClock* clock_; // Not owned. 34 base::TickClock* clock_; // Not owned.
33 double skew_; 35 double skew_;
34 base::TimeTicks last_skew_set_time_; 36 base::TimeTicks last_skew_set_time_;
35 base::TimeTicks skew_clock_at_last_set_; 37 base::TimeTicks skew_clock_at_last_set_;
36 38
37 DISALLOW_COPY_AND_ASSIGN(SkewedTickClock); 39 DISALLOW_COPY_AND_ASSIGN(SkewedTickClock);
38 }; 40 };
39 41
40 } // namespace test 42 } // namespace test
41 } // namespace cast 43 } // namespace cast
42 } // namespace media 44 } // namespace media
43 45
44 #endif // CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H 46 #endif // CAST_MEDIA_TEST_SKEWED_TICK_CLOCK_H
OLDNEW
« no previous file with comments | « media/cast/cast_environment.cc ('k') | media/filters/pipeline_integration_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698