Chromium Code Reviews| Index: base/time/time_posix.cc |
| diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc |
| index 6b08bb3bd2020d71c77f25c2c57db88afb8ed371..22f45d941c4ac48b1d73ab3ac3b8e145fa71ae43 100644 |
| --- a/base/time/time_posix.cc |
| +++ b/base/time/time_posix.cc |
| @@ -320,18 +320,16 @@ TimeTicks TimeTicks::ThreadNow() { |
| #endif |
| } |
| -#if defined(OS_CHROMEOS) |
| -// Force definition of the system trace clock; it is a chromeos-only api |
| -// at the moment and surfacing it in the right place requires mucking |
| -// with glibc et al. |
| -#define CLOCK_SYSTEM_TRACE 11 |
| - |
| +// NaCl IRT does not support the Chrome OS specific clock |
| +// ID. build_nexe.py sets OS_CHROMEOS without any other OS_* macros so |
|
Mark Seaborn
2014/06/03 17:23:28
Maybe say it's common.gypi that does that instead
hamaji
2014/06/03 18:44:08
Yeah, you are right. Sorry for the wrong descripti
|
| +// we need to check __native_client__ explicitly. |
| +#if defined(OS_CHROMEOS) && !defined(__native_client__) |
| // static |
| TimeTicks TimeTicks::NowFromSystemTraceTime() { |
| uint64_t absolute_micro; |
| struct timespec ts; |
| - if (clock_gettime(CLOCK_SYSTEM_TRACE, &ts) != 0) { |
| + if (clock_gettime(kClockSystemTrace, &ts) != 0) { |
|
jln (very slow on Chromium)
2014/06/03 06:15:44
If you want to, you can also COMPILE_ASSERT that k
hamaji
2014/06/03 06:26:49
Hmm I don't understand your suggestion. As written
jln (very slow on Chromium)
2014/06/03 19:10:29
Ahh, sorry I missed that CLOCK_SYSTEM_TRACE was in
|
| // NB: fall-back for a chrome os build running on linux |
| return HighResNow(); |
| } |
| @@ -343,14 +341,14 @@ TimeTicks TimeTicks::NowFromSystemTraceTime() { |
| return TimeTicks(absolute_micro); |
| } |
| -#else // !defined(OS_CHROMEOS) |
| +#else // !(defined(OS_CHROMEOS) && !defined(__native_client__)) |
| // static |
| TimeTicks TimeTicks::NowFromSystemTraceTime() { |
| return HighResNow(); |
| } |
| -#endif // defined(OS_CHROMEOS) |
| +#endif // defined(OS_CHROMEOS) && !defined(__native_client__) |
| #endif // !OS_MACOSX |