From 0251701d2161a1712eec12d122b6ab82a7e3103b Mon Sep 17 00:00:00 2001 From: "hamaji@chromium.org" Date: Fri, 13 Jun 2014 09:28:41 +0000 Subject: Do not define OS_CHROMEOS for untrusted NaCl code so that we do not need !defined(__native_client) for Chrome OS specific clock ID. TEST=Manually checked untrusted code does not have OS_CHROMEOS and trusted code does have it. TEST=trybots BUG=None Review URL: https://codereview.chromium.org/324403002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276985 0039d316-1c4b-4281-b951-d872f2087c98 --- base/time/time_posix.cc | 13 ++++--------- build/common.gypi | 6 +++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/base/time/time_posix.cc b/base/time/time_posix.cc index 3a773bf..b5b8213 100644 --- a/base/time/time_posix.cc +++ b/base/time/time_posix.cc @@ -320,13 +320,8 @@ TimeTicks TimeTicks::ThreadNow() { #endif } -// 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__) +// Use the Chrome OS specific system-wide clock. +#if defined(OS_CHROMEOS) // static TimeTicks TimeTicks::NowFromSystemTraceTime() { uint64_t absolute_micro; @@ -344,14 +339,14 @@ TimeTicks TimeTicks::NowFromSystemTraceTime() { return TimeTicks(absolute_micro); } -#else // !(defined(OS_CHROMEOS) && !defined(__native_client__)) +#else // !defined(OS_CHROMEOS) // static TimeTicks TimeTicks::NowFromSystemTraceTime() { return HighResNow(); } -#endif // defined(OS_CHROMEOS) && !defined(__native_client__) +#endif // defined(OS_CHROMEOS) #endif // !OS_MACOSX diff --git a/build/common.gypi b/build/common.gypi index 8cae8e3..3bfc9e1 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -2453,9 +2453,6 @@ ['enable_one_click_signin==1', { 'defines': ['ENABLE_ONE_CLICK_SIGNIN'], }], - ['chromeos==1', { - 'defines': ['OS_CHROMEOS=1'], - }], ['use_xi2_mt!=0 and use_x11==1', { 'defines': ['USE_XI2_MT=<(use_xi2_mt)'], }], @@ -2796,6 +2793,9 @@ ['<(use_nss)==1 and >(nacl_untrusted_build)==0', { 'defines': ['USE_NSS=1'], }], + ['<(chromeos)==1 and >(nacl_untrusted_build)==0', { + 'defines': ['OS_CHROMEOS=1'], + }], ['enable_wexit_time_destructors==1', { 'conditions': [ [ 'clang==1', { -- cgit v1.1