diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 08:37:08 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-12 08:37:08 +0000 |
commit | 19ea84ca4be1f1aa420e9c86007844eeb1586d77 (patch) | |
tree | dabadca3b57edc51496203066e2d167c95520f1b /base | |
parent | eda3c3641e9f0a8877aff9d0743d3e582e0cdbd9 (diff) | |
download | chromium_src-19ea84ca4be1f1aa420e9c86007844eeb1586d77.zip chromium_src-19ea84ca4be1f1aa420e9c86007844eeb1586d77.tar.gz chromium_src-19ea84ca4be1f1aa420e9c86007844eeb1586d77.tar.bz2 |
Bring up IPC in NaCl.
This patch gets a bunch of the IPC and Base libraries compiling (but not
linking) in NaCl. There's obviously a bunch more work to do, but this patch is
a starting point.
Original patch by Eric Seidel.
Review URL: http://codereview.chromium.org/4812002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/command_line.cc | 2 | ||||
-rw-r--r-- | base/logging.cc | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index 2e6021d..3308e80 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -224,7 +224,7 @@ void CommandLine::Init(int argc, const char* const* argv) { #endif } -#if defined(OS_POSIX) && !defined(OS_MACOSX) +#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_NACL) // static void CommandLine::SetProcTitle() { // Build a single string which consists of all the arguments separated diff --git a/base/logging.cc b/base/logging.cc index 2658519..74f9a87 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -19,7 +19,12 @@ typedef HANDLE MutexHandle; #include <mach/mach_time.h> #include <mach-o/dyld.h> #elif defined(OS_POSIX) +#if defined(OS_NACL) +#include <sys/nacl_syscalls.h> +#include <sys/time.h> // timespec doesn't seem to be in <time.h> +#else #include <sys/syscall.h> +#endif #include <time.h> #endif @@ -128,6 +133,8 @@ int32 CurrentThreadId() { #elif defined(OS_FREEBSD) // TODO(BSD): find a better thread ID return reinterpret_cast<int64>(pthread_self()); +#elif defined(OS_NACL) + return pthread_self(); #endif } @@ -136,6 +143,10 @@ uint64 TickCount() { return GetTickCount(); #elif defined(OS_MACOSX) return mach_absolute_time(); +#elif defined(OS_NACL) + // NaCl sadly does not have _POSIX_TIMERS enabled in sys/features.h + // So we have to use clock() for now. + return clock(); #elif defined(OS_POSIX) struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); |