diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:43:07 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:43:07 +0000 |
commit | 052f1b55d5bcf349a158af65876285d200d92184 (patch) | |
tree | 08ae4ac84c9de04069450dbd4cfc427973182677 /base/logging.cc | |
parent | ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019 (diff) | |
download | chromium_src-052f1b55d5bcf349a158af65876285d200d92184.zip chromium_src-052f1b55d5bcf349a158af65876285d200d92184.tar.gz chromium_src-052f1b55d5bcf349a158af65876285d200d92184.tar.bz2 |
Enabled WebFrameTest, refactored some test shell functions.
Review URL: http://codereview.chromium.org/9652
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r-- | base/logging.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/base/logging.cc b/base/logging.cc index 7d7fb55..7ddbe15 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -8,13 +8,14 @@ #include <windows.h> typedef HANDLE FileHandle; typedef HANDLE MutexHandle; -#endif - -#if defined(OS_MACOSX) +#elif defined(OS_MACOSX) #include <CoreFoundation/CoreFoundation.h> #include <mach/mach.h> #include <mach/mach_time.h> #include <mach-o/dyld.h> +#elif defined(OS_LINUX) +#include <sys/syscall.h> +#include <time.h> #endif #if defined(OS_POSIX) @@ -119,9 +120,8 @@ int32 CurrentThreadId() { return GetCurrentThreadId(); #elif defined(OS_MACOSX) return mach_thread_self(); -#else - NOTIMPLEMENTED(); - return 0; +#elif defined(OS_LINUX) + return syscall(__NR_gettid); #endif } @@ -130,9 +130,15 @@ uint64 TickCount() { return GetTickCount(); #elif defined(OS_MACOSX) return mach_absolute_time(); -#else - NOTIMPLEMENTED(); - return 0; +#elif defined(OS_LINUX) + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + + uint64 absolute_micro = + static_cast<int64>(ts.tv_sec) * 1000000 + + static_cast<int64>(ts.tv_nsec) / 1000; + + return absolute_micro; #endif } |