| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "base/message_pump_mac.h" | 5 #import "base/message_pump_mac.h" |
| 6 | 6 |
| 7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 } | 200 } |
| 201 | 201 |
| 202 // Must be called on the run loop thread. | 202 // Must be called on the run loop thread. |
| 203 void MessagePumpCFRunLoopBase::ScheduleDelayedWork( | 203 void MessagePumpCFRunLoopBase::ScheduleDelayedWork( |
| 204 const TimeTicks& delayed_work_time) { | 204 const TimeTicks& delayed_work_time) { |
| 205 TimeDelta delta = delayed_work_time - TimeTicks::Now(); | 205 TimeDelta delta = delayed_work_time - TimeTicks::Now(); |
| 206 delayed_work_fire_time_ = CFAbsoluteTimeGetCurrent() + delta.InSecondsF(); | 206 delayed_work_fire_time_ = CFAbsoluteTimeGetCurrent() + delta.InSecondsF(); |
| 207 CFRunLoopTimerSetNextFireDate(delayed_work_timer_, delayed_work_fire_time_); | 207 CFRunLoopTimerSetNextFireDate(delayed_work_timer_, delayed_work_fire_time_); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void MessagePumpCFRunLoopBase::Shutdown() { |
| 211 } |
| 212 |
| 210 // Called from the run loop. | 213 // Called from the run loop. |
| 211 // static | 214 // static |
| 212 void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer, | 215 void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer, |
| 213 void* info) { | 216 void* info) { |
| 214 MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); | 217 MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
| 215 | 218 |
| 216 // The timer won't fire again until it's reset. | 219 // The timer won't fire again until it's reset. |
| 217 self->delayed_work_fire_time_ = kCFTimeIntervalMax; | 220 self->delayed_work_fire_time_ = kCFTimeIntervalMax; |
| 218 | 221 |
| 219 // CFRunLoopTimers fire outside of the priority scheme for CFRunLoopSources. | 222 // CFRunLoopTimers fire outside of the priority scheme for CFRunLoopSources. |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 [NSApplication sharedApplication]; | 695 [NSApplication sharedApplication]; |
| 693 g_not_using_cr_app = true; | 696 g_not_using_cr_app = true; |
| 694 return new MessagePumpNSApplication; | 697 return new MessagePumpNSApplication; |
| 695 #endif | 698 #endif |
| 696 } | 699 } |
| 697 | 700 |
| 698 return new MessagePumpNSRunLoop; | 701 return new MessagePumpNSRunLoop; |
| 699 } | 702 } |
| 700 | 703 |
| 701 } // namespace base | 704 } // namespace base |
| OLD | NEW |