| OLD | NEW |
| 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/time.h" | 5 #include "base/time/time.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <sys/time.h> | 8 #include <sys/time.h> |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 #if defined(OS_ANDROID) && !defined(__LP64__) | 10 #if defined(OS_ANDROID) && !defined(__LP64__) |
| 11 #include <time64.h> | 11 #include <time64.h> |
| 12 #endif | 12 #endif |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 | 14 |
| 15 #include <limits> | 15 #include <limits> |
| 16 #include <ostream> | 16 #include <ostream> |
| 17 | 17 |
| 18 #include "base/basictypes.h" | 18 #include "base/basictypes.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/port.h" | |
| 21 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 22 | 21 |
| 23 #if defined(OS_ANDROID) | 22 #if defined(OS_ANDROID) |
| 24 #include "base/os_compat_android.h" | 23 #include "base/os_compat_android.h" |
| 25 #elif defined(OS_NACL) | 24 #elif defined(OS_NACL) |
| 26 #include "base/os_compat_nacl.h" | 25 #include "base/os_compat_nacl.h" |
| 27 #endif | 26 #endif |
| 28 | 27 |
| 29 #if !defined(OS_MACOSX) | 28 #if !defined(OS_MACOSX) |
| 30 #include "base/lazy_instance.h" | 29 #include "base/lazy_instance.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 result.tv_usec = static_cast<suseconds_t>(Time::kMicrosecondsPerSecond) - 1; | 379 result.tv_usec = static_cast<suseconds_t>(Time::kMicrosecondsPerSecond) - 1; |
| 381 return result; | 380 return result; |
| 382 } | 381 } |
| 383 int64 us = us_ - kTimeTToMicrosecondsOffset; | 382 int64 us = us_ - kTimeTToMicrosecondsOffset; |
| 384 result.tv_sec = us / Time::kMicrosecondsPerSecond; | 383 result.tv_sec = us / Time::kMicrosecondsPerSecond; |
| 385 result.tv_usec = us % Time::kMicrosecondsPerSecond; | 384 result.tv_usec = us % Time::kMicrosecondsPerSecond; |
| 386 return result; | 385 return result; |
| 387 } | 386 } |
| 388 | 387 |
| 389 } // namespace base | 388 } // namespace base |
| OLD | NEW |