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

Side by Side Diff: base/time_mac.cc

Issue 5042001: Put the parentheses back where they belong in time_mac.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 1 month 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 | « no previous file | 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) 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 "base/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_time.h> 9 #include <mach/mach_time.h>
10 #include <sys/time.h> 10 #include <sys/time.h>
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 base::mac::ScopedCFTypeRef<CFTimeZoneRef> 73 base::mac::ScopedCFTypeRef<CFTimeZoneRef>
74 time_zone(is_local ? CFTimeZoneCopySystem() : NULL); 74 time_zone(is_local ? CFTimeZoneCopySystem() : NULL);
75 CFAbsoluteTime seconds = CFGregorianDateGetAbsoluteTime(date, time_zone) + 75 CFAbsoluteTime seconds = CFGregorianDateGetAbsoluteTime(date, time_zone) +
76 kCFAbsoluteTimeIntervalSince1970; 76 kCFAbsoluteTimeIntervalSince1970;
77 return Time(static_cast<int64>(seconds * kMicrosecondsPerSecond) + 77 return Time(static_cast<int64>(seconds * kMicrosecondsPerSecond) +
78 kWindowsEpochDeltaMicroseconds); 78 kWindowsEpochDeltaMicroseconds);
79 } 79 }
80 80
81 void Time::Explode(bool is_local, Exploded* exploded) const { 81 void Time::Explode(bool is_local, Exploded* exploded) const {
82 CFAbsoluteTime seconds = 82 CFAbsoluteTime seconds =
83 (static_cast<double>((us_ - kWindowsEpochDeltaMicroseconds) / 83 ((static_cast<double>(us_) - kWindowsEpochDeltaMicroseconds) /
84 kMicrosecondsPerSecond) - kCFAbsoluteTimeIntervalSince1970); 84 kMicrosecondsPerSecond) - kCFAbsoluteTimeIntervalSince1970;
85 85
86 base::mac::ScopedCFTypeRef<CFTimeZoneRef> 86 base::mac::ScopedCFTypeRef<CFTimeZoneRef>
87 time_zone(is_local ? CFTimeZoneCopySystem() : NULL); 87 time_zone(is_local ? CFTimeZoneCopySystem() : NULL);
88 CFGregorianDate date = CFAbsoluteTimeGetGregorianDate(seconds, time_zone); 88 CFGregorianDate date = CFAbsoluteTimeGetGregorianDate(seconds, time_zone);
89 89
90 exploded->year = date.year; 90 exploded->year = date.year;
91 exploded->month = date.month; 91 exploded->month = date.month;
92 exploded->day_of_month = date.day; 92 exploded->day_of_month = date.day;
93 exploded->hour = date.hour; 93 exploded->hour = date.hour;
94 exploded->minute = date.minute; 94 exploded->minute = date.minute;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 return TimeTicks(absolute_micro); 131 return TimeTicks(absolute_micro);
132 } 132 }
133 133
134 // static 134 // static
135 TimeTicks TimeTicks::HighResNow() { 135 TimeTicks TimeTicks::HighResNow() {
136 return Now(); 136 return Now();
137 } 137 }
138 138
139 } // namespace base 139 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698