Chromium Code Reviews| 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..e677bd882c62bed1046426a4fe164167ee990879 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> |
| + |
| +#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); |
|
kapishnikov
2017/05/10 18:10:11
One extra comment. Maybe we should check the resul
Ryan Hamilton
2017/05/10 19:07:47
Done. If this sloshes back and forth, that would b
|
| + return CreateTimeFromMicroseconds(tp.tv_sec * 1000000 + tp.tv_nsec / 1000); |
| + } |
| +#endif |
| + return CreateTimeFromMicroseconds(base::TimeTicks::Now().ToInternalValue()); |
| } |
| QuicWallTime QuicChromiumClock::WallNow() const { |