提交 c82bddca 编写于 作者: C Chinmay Garde

Merge pull request #2142 from chinmaygarde/master

Enable ThreadTime support on iOS
...@@ -733,7 +733,7 @@ class BASE_EXPORT ThreadTicks : public time_internal::TimeBase<ThreadTicks> { ...@@ -733,7 +733,7 @@ class BASE_EXPORT ThreadTicks : public time_internal::TimeBase<ThreadTicks> {
// Returns true if ThreadTicks::Now() is supported on this system. // Returns true if ThreadTicks::Now() is supported on this system.
static bool IsSupported() { static bool IsSupported() {
#if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \ #if (defined(_POSIX_THREAD_CPUTIME) && (_POSIX_THREAD_CPUTIME >= 0)) || \
(defined(OS_MACOSX) && !defined(OS_IOS)) || defined(OS_ANDROID) defined(OS_MACOSX) || defined(OS_ANDROID)
return true; return true;
#else #else
return false; return false;
......
...@@ -69,10 +69,6 @@ int64_t ComputeCurrentTicks() { ...@@ -69,10 +69,6 @@ int64_t ComputeCurrentTicks() {
} }
int64_t ComputeThreadTicks() { int64_t ComputeThreadTicks() {
#if defined(OS_IOS)
NOTREACHED();
return 0;
#else
base::mac::ScopedMachSendRight thread(mach_thread_self()); base::mac::ScopedMachSendRight thread(mach_thread_self());
mach_msg_type_number_t thread_info_count = THREAD_BASIC_INFO_COUNT; mach_msg_type_number_t thread_info_count = THREAD_BASIC_INFO_COUNT;
thread_basic_info_data_t thread_info_data; thread_basic_info_data_t thread_info_data;
...@@ -94,7 +90,6 @@ int64_t ComputeThreadTicks() { ...@@ -94,7 +90,6 @@ int64_t ComputeThreadTicks() {
absolute_micros *= base::Time::kMicrosecondsPerSecond; absolute_micros *= base::Time::kMicrosecondsPerSecond;
absolute_micros += thread_info_data.user_time.microseconds; absolute_micros += thread_info_data.user_time.microseconds;
return absolute_micros.ValueOrDie(); return absolute_micros.ValueOrDie();
#endif // defined(OS_IOS)
} }
} // namespace } // namespace
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册