Index: base/message_pump_mac.mm |
diff --git a/base/message_pump_mac.mm b/base/message_pump_mac.mm |
index e7c422ba6cbde6b523bf0fc5de7d111bec5b0b36..6f0b1b2ac08a7705b2ce91879a57ae4126897619 100644 |
--- a/base/message_pump_mac.mm |
+++ b/base/message_pump_mac.mm |
@@ -192,28 +192,8 @@ void MessagePumpCFRunLoopBase::ScheduleWork() { |
// Must be called on the run loop thread. |
void MessagePumpCFRunLoopBase::ScheduleDelayedWork( |
const TimeTicks& delayed_work_time) { |
- // TODO(jar): We may need a more efficient way to go between these times, but |
- // the difference will change not only when we sleep/wake, it will also change |
- // when the user changes the wall clock time :-/. |
- Time absolute_work_time = |
- (delayed_work_time - TimeTicks::Now()) + Time::Now(); |
- |
- Time::Exploded exploded; |
- absolute_work_time.UTCExplode(&exploded); |
- double seconds = exploded.second + |
- (static_cast<double>((absolute_work_time.ToInternalValue()) % |
- Time::kMicrosecondsPerSecond) / |
- Time::kMicrosecondsPerSecond); |
- CFGregorianDate gregorian = { |
- exploded.year, |
- exploded.month, |
- exploded.day_of_month, |
- exploded.hour, |
- exploded.minute, |
- seconds |
- }; |
- delayed_work_fire_time_ = CFGregorianDateGetAbsoluteTime(gregorian, NULL); |
- |
+ TimeDelta delta = delayed_work_time - TimeTicks::Now(); |
+ delayed_work_fire_time_ = CFAbsoluteTimeGetCurrent() + delta.InSecondsF(); |
CFRunLoopTimerSetNextFireDate(delayed_work_timer_, delayed_work_fire_time_); |
} |