Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: base/time_posix.cc

Issue 9465017: Make more of base compile with the Native Client toolchain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/time.h" 5 #include "base/time.h"
6 6
7 #include <sys/time.h> 7 #include <sys/time.h>
8 #include <time.h> 8 #include <time.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 10
11 #include <limits> 11 #include <limits>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 15
16 #if defined(OS_ANDROID) 16 #if defined(OS_ANDROID)
17 #include "base/os_compat_android.h" 17 #include "base/os_compat_android.h"
18 #elif defined(OS_NACL)
19 #include "base/os_compat_nacl.h"
18 #endif 20 #endif
19 21
20 namespace base { 22 namespace base {
21 23
22 #if defined(OS_ANDROID) 24 #if defined(OS_ANDROID)
23 #define _POSIX_MONOTONIC_CLOCK 1 25 #define _POSIX_MONOTONIC_CLOCK 1
24 #endif 26 #endif
25 27
26 struct timespec TimeDelta::ToTimeSpec() const { 28 struct timespec TimeDelta::ToTimeSpec() const {
27 int64 microseconds = InMicroseconds(); 29 int64 microseconds = InMicroseconds();
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 232
231 struct timeval Time::ToTimeVal() const { 233 struct timeval Time::ToTimeVal() const {
232 struct timeval result; 234 struct timeval result;
233 int64 us = us_ - kTimeTToMicrosecondsOffset; 235 int64 us = us_ - kTimeTToMicrosecondsOffset;
234 result.tv_sec = us / Time::kMicrosecondsPerSecond; 236 result.tv_sec = us / Time::kMicrosecondsPerSecond;
235 result.tv_usec = us % Time::kMicrosecondsPerSecond; 237 result.tv_usec = us % Time::kMicrosecondsPerSecond;
236 return result; 238 return result;
237 } 239 }
238 240
239 } // namespace base 241 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/platform_thread_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698