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
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 @@
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 @@
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
}