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

Side by Side Diff: media/cast/cast_ntp_tick_clock.h

Issue 34623008: Change to calculate the real NTP in TimeTicks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
OLDNEW
(Empty)
1 // Copyright 2013 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.
4
5 #ifndef MEDIA_CAST_CAST_NTP_TICK_CLOCK_H_
6 #define MEDIA_CAST_CAST_NTP_TICK_CLOCK_H_
7
8 #include "base/basictypes.h"
9 #include "base/time/default_tick_clock.h"
10 #include "base/time/tick_clock.h"
11 #include "base/time/time.h"
12 #include "media/cast/cast_defines.h"
13
14 namespace media {
15 namespace cast {
16
17 // Class that provide the a TickTime relative to NTP. The base TickTime does not
18 // reference a specific date. This version is number of ticks relative to 0h UTC
19 // on 1 January 1900.
20 // Note: We only synchronize with the system clock at creation time after that
21 // we only use our relative difference this can result in a drift relative to
22 // the system clock however this approach guarantees that our NTP time never
23 // decrease.
24
25 class CastNtpTickClock : public base::TickClock {
26 public:
27 CastNtpTickClock();
28 virtual ~CastNtpTickClock();
29
30 virtual base::TimeTicks NowTicks() OVERRIDE;
31
32 protected:
33 // Provided for testability.
34 void SetTickClock(base::TickClock* tick_clock);
35
36 private:
37 base::DefaultTickClock default_tick_clock_;
38 base::TickClock* tick_clock_;
39
40 DISALLOW_COPY_AND_ASSIGN(CastNtpTickClock);
41 };
42
43 } // namespace cast
44 } // namespace media
45
46 #endif // MEDIA_CAST_CAST_NTP_TICK_CLOCK_H_
47
48
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698