OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFDate.h> |
6 | 6 #include </Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/CoreFoundatio
n.framework/Headers/CFTimeZone.h> |
7 #include <CoreFoundation/CFDate.h> | 7 #include <mach/i386/kern_return.h> |
8 #include <CoreFoundation/CFTimeZone.h> | 8 #include <mach/kern_return.h> |
9 #include <mach/mach_time.h> | 9 #include <mach/mach_time.h> |
10 #include <sys/time.h> | 10 #include <stdbool.h> |
| 11 #include <stdint.h> |
11 #include <time.h> | 12 #include <time.h> |
12 | 13 |
13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/mac/scoped_cftyperef.h" | 16 #include "base/mac/scoped_cftyperef.h" |
| 17 #include "base/port.h" |
| 18 #include "base/time.h" |
16 | 19 |
17 namespace base { | 20 namespace base { |
18 | 21 |
19 // The Time routines in this file use Mach and CoreFoundation APIs, since the | 22 // The Time routines in this file use Mach and CoreFoundation APIs, since the |
20 // POSIX definition of time_t in Mac OS X wraps around after 2038--and | 23 // POSIX definition of time_t in Mac OS X wraps around after 2038--and |
21 // there are already cookie expiration dates, etc., past that time out in | 24 // there are already cookie expiration dates, etc., past that time out in |
22 // the field. Using CFDate prevents that problem, and using mach_absolute_time | 25 // the field. Using CFDate prevents that problem, and using mach_absolute_time |
23 // for TimeTicks gives us nice high-resolution interval timing. | 26 // for TimeTicks gives us nice high-resolution interval timing. |
24 | 27 |
25 // Time ----------------------------------------------------------------------- | 28 // Time ----------------------------------------------------------------------- |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 133 |
131 return TimeTicks(absolute_micro); | 134 return TimeTicks(absolute_micro); |
132 } | 135 } |
133 | 136 |
134 // static | 137 // static |
135 TimeTicks TimeTicks::HighResNow() { | 138 TimeTicks TimeTicks::HighResNow() { |
136 return Now(); | 139 return Now(); |
137 } | 140 } |
138 | 141 |
139 } // namespace base | 142 } // namespace base |
OLD | NEW |