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

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

Issue 1128203010: base: Remove the remaining usage GG_(U)INTn_C macros. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 7 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/strings/string_number_conversions_unittest.cc ('k') | base/time/time_posix.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 <CoreFoundation/CFDate.h> 7 #include <CoreFoundation/CFDate.h>
8 #include <CoreFoundation/CFTimeZone.h> 8 #include <CoreFoundation/CFTimeZone.h>
9 #include <mach/mach.h> 9 #include <mach/mach.h>
10 #include <mach/mach_time.h> 10 #include <mach/mach_time.h>
11 #include <stdint.h>
11 #include <sys/sysctl.h> 12 #include <sys/sysctl.h>
12 #include <sys/time.h> 13 #include <sys/time.h>
13 #include <sys/types.h> 14 #include <sys/types.h>
14 #include <time.h> 15 #include <time.h>
15 16
16 #include "base/basictypes.h" 17 #include "base/basictypes.h"
17 #include "base/logging.h" 18 #include "base/logging.h"
18 #include "base/mac/mach_logging.h" 19 #include "base/mac/mach_logging.h"
19 #include "base/mac/scoped_cftyperef.h" 20 #include "base/mac/scoped_cftyperef.h"
20 #include "base/mac/scoped_mach_port.h" 21 #include "base/mac/scoped_mach_port.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Time ----------------------------------------------------------------------- 108 // Time -----------------------------------------------------------------------
108 109
109 // Core Foundation uses a double second count since 2001-01-01 00:00:00 UTC. 110 // Core Foundation uses a double second count since 2001-01-01 00:00:00 UTC.
110 // The UNIX epoch is 1970-01-01 00:00:00 UTC. 111 // The UNIX epoch is 1970-01-01 00:00:00 UTC.
111 // Windows uses a Gregorian epoch of 1601. We need to match this internally 112 // Windows uses a Gregorian epoch of 1601. We need to match this internally
112 // so that our time representations match across all platforms. See bug 14734. 113 // so that our time representations match across all platforms. See bug 14734.
113 // irb(main):010:0> Time.at(0).getutc() 114 // irb(main):010:0> Time.at(0).getutc()
114 // => Thu Jan 01 00:00:00 UTC 1970 115 // => Thu Jan 01 00:00:00 UTC 1970
115 // irb(main):011:0> Time.at(-11644473600).getutc() 116 // irb(main):011:0> Time.at(-11644473600).getutc()
116 // => Mon Jan 01 00:00:00 UTC 1601 117 // => Mon Jan 01 00:00:00 UTC 1601
117 static const int64 kWindowsEpochDeltaSeconds = GG_INT64_C(11644473600); 118 static const int64 kWindowsEpochDeltaSeconds = INT64_C(11644473600);
118 119
119 // static 120 // static
120 const int64 Time::kWindowsEpochDeltaMicroseconds = 121 const int64 Time::kWindowsEpochDeltaMicroseconds =
121 kWindowsEpochDeltaSeconds * Time::kMicrosecondsPerSecond; 122 kWindowsEpochDeltaSeconds * Time::kMicrosecondsPerSecond;
122 123
123 // Some functions in time.cc use time_t directly, so we provide an offset 124 // Some functions in time.cc use time_t directly, so we provide an offset
124 // to convert from time_t (Unix epoch) and internal (Windows epoch). 125 // to convert from time_t (Unix epoch) and internal (Windows epoch).
125 // static 126 // static
126 const int64 Time::kTimeTToMicrosecondsOffset = kWindowsEpochDeltaMicroseconds; 127 const int64 Time::kTimeTToMicrosecondsOffset = kWindowsEpochDeltaMicroseconds;
127 128
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 TimeTicks TimeTicks::ThreadNow() { 228 TimeTicks TimeTicks::ThreadNow() {
228 return TimeTicks(ComputeThreadTicks()); 229 return TimeTicks(ComputeThreadTicks());
229 } 230 }
230 231
231 // static 232 // static
232 TimeTicks TimeTicks::NowFromSystemTraceTime() { 233 TimeTicks TimeTicks::NowFromSystemTraceTime() {
233 return Now(); 234 return Now();
234 } 235 }
235 236
236 } // namespace base 237 } // namespace base
OLDNEW
« no previous file with comments | « base/strings/string_number_conversions_unittest.cc ('k') | base/time/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698