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

Unified Diff: webrtc/test/drifting_clock.cc

Issue 2733823002: Replace Clock::CurrentNtp with Clock::CurrentNtpTime (Closed)
Patch Set: Remove CurrentNtp instead of deprecate Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/drifting_clock.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/drifting_clock.cc
diff --git a/webrtc/test/drifting_clock.cc b/webrtc/test/drifting_clock.cc
index 76f17235ceb9cdb0351dd368cc43f695da76a264..b11077641d7b915602b533f38e11beff4bee6e71 100644
--- a/webrtc/test/drifting_clock.cc
+++ b/webrtc/test/drifting_clock.cc
@@ -39,15 +39,14 @@ int64_t DriftingClock::TimeInMicroseconds() const {
return clock_->TimeInMicroseconds() + Drift();
}
-void DriftingClock::CurrentNtp(uint32_t& seconds, uint32_t& fractions) const {
+NtpTime DriftingClock::CurrentNtpTime() const {
// NTP precision is 1/2^32 seconds, i.e. 2^32 ntp fractions = 1 second.
const double kNtpFracPerMicroSecond = 4294.967296; // = 2^32 / 10^6
- clock_->CurrentNtp(seconds, fractions);
- uint64_t total_fractions = (static_cast<uint64_t>(seconds) << 32) | fractions;
+ NtpTime ntp = clock_->CurrentNtpTime();
+ uint64_t total_fractions = static_cast<uint64_t>(ntp);
total_fractions += Drift() * kNtpFracPerMicroSecond;
- seconds = total_fractions >> 32;
- fractions = static_cast<uint32_t>(total_fractions);
+ return NtpTime(total_fractions);
}
int64_t DriftingClock::CurrentNtpInMilliseconds() const {
« no previous file with comments | « webrtc/test/drifting_clock.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698