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

Side by Side Diff: base/time/time_posix.cc

Issue 2691573003: base: Remove auto raw pointer deduction. (Closed)
Patch Set: update Created 3 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
« no previous file with comments | « base/threading/worker_pool.cc ('k') | base/trace_event/trace_log.cc » ('j') | 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/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__)
(...skipping 17 matching lines...) Expand all
28 #if !defined(OS_MACOSX) 28 #if !defined(OS_MACOSX)
29 #include "base/synchronization/lock.h" 29 #include "base/synchronization/lock.h"
30 #endif 30 #endif
31 31
32 namespace { 32 namespace {
33 33
34 #if !defined(OS_MACOSX) 34 #if !defined(OS_MACOSX)
35 // This prevents a crash on traversing the environment global and looking up 35 // This prevents a crash on traversing the environment global and looking up
36 // the 'TZ' variable in libc. See: crbug.com/390567. 36 // the 'TZ' variable in libc. See: crbug.com/390567.
37 base::Lock* GetSysTimeToTimeStructLock() { 37 base::Lock* GetSysTimeToTimeStructLock() {
38 static auto lock = new base::Lock(); 38 static auto* lock = new base::Lock();
39 return lock; 39 return lock;
40 } 40 }
41 41
42 // Define a system-specific SysTime that wraps either to a time_t or 42 // Define a system-specific SysTime that wraps either to a time_t or
43 // a time64_t depending on the host system, and associated convertion. 43 // a time64_t depending on the host system, and associated convertion.
44 // See crbug.com/162007 44 // See crbug.com/162007
45 #if defined(OS_ANDROID) && !defined(__LP64__) 45 #if defined(OS_ANDROID) && !defined(__LP64__)
46 typedef time64_t SysTime; 46 typedef time64_t SysTime;
47 47
48 SysTime SysTimeFromTimeStruct(struct tm* timestruct, bool is_local) { 48 SysTime SysTimeFromTimeStruct(struct tm* timestruct, bool is_local) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 result.tv_usec = static_cast<suseconds_t>(Time::kMicrosecondsPerSecond) - 1; 420 result.tv_usec = static_cast<suseconds_t>(Time::kMicrosecondsPerSecond) - 1;
421 return result; 421 return result;
422 } 422 }
423 int64_t us = us_ - kTimeTToMicrosecondsOffset; 423 int64_t us = us_ - kTimeTToMicrosecondsOffset;
424 result.tv_sec = us / Time::kMicrosecondsPerSecond; 424 result.tv_sec = us / Time::kMicrosecondsPerSecond;
425 result.tv_usec = us % Time::kMicrosecondsPerSecond; 425 result.tv_usec = us % Time::kMicrosecondsPerSecond;
426 return result; 426 return result;
427 } 427 }
428 428
429 } // namespace base 429 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool.cc ('k') | base/trace_event/trace_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698