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

Unified Diff: base/time_mac.cc

Issue 9342: Turn time_mac.cc back on, with workaround for scoped_cftyperef reset bug (Closed) Base URL: svn://localhost/chrome/trunk/src/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base.xcodeproj/project.pbxproj ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time_mac.cc
===================================================================
--- base/time_mac.cc (revision 4629)
+++ base/time_mac.cc (working copy)
@@ -28,7 +28,7 @@
// from 1970-01-01 00:00:00 UTC. Core Foundation uses a double second count
// since 2001-01-01 00:00:00 UTC.
-// Some functions in time.c use time_t directly, so we provide a zero offset
+// Some functions in time.cc use time_t directly, so we provide a zero offset
// for them. The epoch is 1970-01-01 00:00:00 UTC.
// static
const int64 Time::kTimeTToMicrosecondsOffset = GG_INT64_C(0);
@@ -51,9 +51,8 @@
date.month = exploded.month;
date.year = exploded.year;
- scoped_cftyperef<CFTimeZoneRef> time_zone;
- if (is_local)
- time_zone.reset(CFTimeZoneCopySystem());
+ scoped_cftyperef<CFTimeZoneRef>
+ time_zone(is_local ? CFTimeZoneCopySystem() : NULL);
CFAbsoluteTime seconds = CFGregorianDateGetAbsoluteTime(date, time_zone) +
kCFAbsoluteTimeIntervalSince1970;
return Time(static_cast<int64>(seconds * kMicrosecondsPerSecond));
@@ -64,9 +63,8 @@
(static_cast<double>(us_) / kMicrosecondsPerSecond) -
kCFAbsoluteTimeIntervalSince1970;
- scoped_cftyperef<CFTimeZoneRef> time_zone;
- if (is_local)
- time_zone.reset(CFTimeZoneCopySystem());
+ scoped_cftyperef<CFTimeZoneRef>
+ time_zone(is_local ? CFTimeZoneCopySystem() : NULL);
CFGregorianDate date = CFAbsoluteTimeGetGregorianDate(seconds, time_zone);
exploded->year = date.year;
« no previous file with comments | « base/base.xcodeproj/project.pbxproj ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698