Index: net/quic/platform/impl/quic_chromium_clock.cc |
diff --git a/net/quic/platform/impl/quic_chromium_clock.cc b/net/quic/platform/impl/quic_chromium_clock.cc |
index cbf1ed1b14e2c94199da029c3ec1a69e13a7a96a..c6fcdf590879a35ecae64107ce346d43c1298693 100644 |
--- a/net/quic/platform/impl/quic_chromium_clock.cc |
+++ b/net/quic/platform/impl/quic_chromium_clock.cc |
@@ -4,6 +4,12 @@ |
#include "net/quic/platform/impl/quic_chromium_clock.h" |
+#if defined(OS_IOS) |
+#include <time.h> |
ianswett
2017/05/10 10:44:13
nit: Should this be indented, like it is below?
Ryan Hamilton
2017/05/10 13:17:27
I don't think so, because #includes are not indent
|
+ |
+#include "base/ios/ios_util.h" |
+#endif |
+ |
#include "base/memory/singleton.h" |
#include "base/time/time.h" |
@@ -23,7 +29,14 @@ QuicTime QuicChromiumClock::ApproximateNow() const { |
} |
QuicTime QuicChromiumClock::Now() const { |
- return QuicTime(base::TimeTicks::Now()); |
+#if defined(OS_IOS) |
+ if (base::ios::IsRunningOnIOS10OrLater()) { |
+ struct timespec tp; |
+ clock_gettime(CLOCK_MONOTONIC, &tp); |
+ return CreateTimeFromMicroseconds(tp.tv_nsec / 1000); |
kapishnikov
2017/05/10 15:25:38
Should it be:
return CreateTimeFromMicroseconds(tp
Ryan Hamilton
2017/05/10 17:05:56
Done.
|
+ } |
+#endif |
+ return CreateTimeFromMicroseconds(base::TimeTicks::Now().ToInternalValue()); |
ianswett
2017/05/10 11:40:36
As mentioned in the thread, Ideally we'd update ba
Ryan Hamilton
2017/05/10 13:17:27
That's beyond the scope of this CL, but I'll talk
|
} |
QuicWallTime QuicChromiumClock::WallNow() const { |