summaryrefslogtreecommitdiffstats
path: root/base/time_mac.cc
diff options
context:
space:
mode:
authoramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 20:36:11 +0000
committeramanda@chromium.org <amanda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-04 20:36:11 +0000
commit1b5753a6785ee2caf6bbf417d4b8d6ec9a9ef9a4 (patch)
tree92d8086b581bcd110186977f8a29b4eed7112630 /base/time_mac.cc
parentc6959f825761fc056b1976162861776c95782af1 (diff)
downloadchromium_src-1b5753a6785ee2caf6bbf417d4b8d6ec9a9ef9a4.zip
chromium_src-1b5753a6785ee2caf6bbf417d4b8d6ec9a9ef9a4.tar.gz
chromium_src-1b5753a6785ee2caf6bbf417d4b8d6ec9a9ef9a4.tar.bz2
Turn time_mac.cc back on, with workaround for scoped_cftyperef reset bug
Review URL: http://codereview.chromium.org/9342 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4641 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/time_mac.cc')
-rw-r--r--base/time_mac.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/base/time_mac.cc b/base/time_mac.cc
index d71825c..7f17c52 100644
--- a/base/time_mac.cc
+++ b/base/time_mac.cc
@@ -28,7 +28,7 @@ namespace base {
// 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 @@ Time Time::FromExploded(bool is_local, const Exploded& exploded) {
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 @@ void Time::Explode(bool is_local, Exploded* exploded) const {
(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;