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

Unified Diff: webrtc/system_wrappers/source/clock.cc

Issue 2393723004: replace NtpTime->Clock with Clock->NtpTime dependency (Closed)
Patch Set: . Created 3 years, 10 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/system_wrappers/include/ntp_time.h ('k') | webrtc/system_wrappers/source/ntp_time_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/source/clock.cc
diff --git a/webrtc/system_wrappers/source/clock.cc b/webrtc/system_wrappers/source/clock.cc
index 05dabd8538ccfc5de82585773a2637f6a4428a46..f31556fc4ff38b1073877bdd2ea8ee264276dfec 100644
--- a/webrtc/system_wrappers/source/clock.cc
+++ b/webrtc/system_wrappers/source/clock.cc
@@ -25,12 +25,11 @@
namespace webrtc {
-const double kNtpFracPerMs = 4.294967296E6;
-
-int64_t Clock::NtpToMs(uint32_t ntp_secs, uint32_t ntp_frac) {
- const double ntp_frac_ms = static_cast<double>(ntp_frac) / kNtpFracPerMs;
- return 1000 * static_cast<int64_t>(ntp_secs) +
- static_cast<int64_t>(ntp_frac_ms + 0.5);
+NtpTime Clock::CurrentNtpTime() const {
+ uint32_t seconds;
+ uint32_t fractions;
+ CurrentNtp(seconds, fractions);
+ return NtpTime(seconds, fractions);
}
class RealTimeClock : public Clock {
« no previous file with comments | « webrtc/system_wrappers/include/ntp_time.h ('k') | webrtc/system_wrappers/source/ntp_time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698