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

Unified Diff: base/time/time_posix.cc

Issue 298163008: Non-SFI NaCl: Allow CLOCK_SYSTEM_TRACE on Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use only OS_LINUX to decide whether we define kClockSystemTrace Created 6 years, 7 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 | « base/time/time.h ('k') | components/nacl/loader/nonsfi/nonsfi_sandbox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/time/time.h ('k') | components/nacl/loader/nonsfi/nonsfi_sandbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698