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

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: comment update 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..3037c98bd897779d64b78d630e750d5a539b0f1a 100644
--- a/base/time/time_posix.cc
+++ b/base/time/time_posix.cc
@@ -320,18 +320,19 @@ 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/common.gypi sets OS_CHROMEOS without any other OS_*
+// macros for untrusted NaCl build so we need to check
+// __native_client__ explicitly.
+// TODO(hamaji): Do not specify OS_CHROMEOS for untrusted NaCl build
+// and remove !defined(__native_client__).
+#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) {
// NB: fall-back for a chrome os build running on linux
return HighResNow();
}
@@ -343,14 +344,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