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_loop/message_pump_mac.h" | 5 #import "base/message_loop/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 | |
213 // Called from the run loop. | 210 // Called from the run loop. |
214 // static | 211 // static |
215 void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer, | 212 void MessagePumpCFRunLoopBase::RunDelayedWorkTimer(CFRunLoopTimerRef timer, |
216 void* info) { | 213 void* info) { |
217 MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); | 214 MessagePumpCFRunLoopBase* self = static_cast<MessagePumpCFRunLoopBase*>(info); |
218 | 215 |
219 // The timer won't fire again until it's reset. | 216 // The timer won't fire again until it's reset. |
220 self->delayed_work_fire_time_ = kCFTimeIntervalMax; | 217 self->delayed_work_fire_time_ = kCFTimeIntervalMax; |
221 | 218 |
222 // CFRunLoopTimers fire outside of the priority scheme for CFRunLoopSources. | 219 // CFRunLoopTimers fire outside of the priority scheme for CFRunLoopSources. |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 [NSApplication sharedApplication]; | 692 [NSApplication sharedApplication]; |
696 g_not_using_cr_app = true; | 693 g_not_using_cr_app = true; |
697 return new MessagePumpNSApplication; | 694 return new MessagePumpNSApplication; |
698 #endif | 695 #endif |
699 } | 696 } |
700 | 697 |
701 return new MessagePumpNSRunLoop; | 698 return new MessagePumpNSRunLoop; |
702 } | 699 } |
703 | 700 |
704 } // namespace base | 701 } // namespace base |
OLD | NEW |