OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 NOTREACHED() << "Must be inside Run to call Quit"; | 225 NOTREACHED() << "Must be inside Run to call Quit"; |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 void MessageLoop::PostTask( | 229 void MessageLoop::PostTask( |
230 const tracked_objects::Location& from_here, Task* task) { | 230 const tracked_objects::Location& from_here, Task* task) { |
231 PostTask_Helper(from_here, task, 0, true); | 231 PostTask_Helper(from_here, task, 0, true); |
232 } | 232 } |
233 | 233 |
234 void MessageLoop::PostDelayedTask( | 234 void MessageLoop::PostDelayedTask( |
235 const tracked_objects::Location& from_here, Task* task, int delay_ms) { | 235 const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { |
236 PostTask_Helper(from_here, task, delay_ms, true); | 236 PostTask_Helper(from_here, task, delay_ms, true); |
237 } | 237 } |
238 | 238 |
239 void MessageLoop::PostNonNestableTask( | 239 void MessageLoop::PostNonNestableTask( |
240 const tracked_objects::Location& from_here, Task* task) { | 240 const tracked_objects::Location& from_here, Task* task) { |
241 PostTask_Helper(from_here, task, 0, false); | 241 PostTask_Helper(from_here, task, 0, false); |
242 } | 242 } |
243 | 243 |
244 void MessageLoop::PostNonNestableDelayedTask( | 244 void MessageLoop::PostNonNestableDelayedTask( |
245 const tracked_objects::Location& from_here, Task* task, int delay_ms) { | 245 const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { |
246 PostTask_Helper(from_here, task, delay_ms, false); | 246 PostTask_Helper(from_here, task, delay_ms, false); |
247 } | 247 } |
248 | 248 |
249 // Possibly called on a background thread! | 249 // Possibly called on a background thread! |
250 void MessageLoop::PostTask_Helper( | 250 void MessageLoop::PostTask_Helper( |
251 const tracked_objects::Location& from_here, Task* task, int delay_ms, | 251 const tracked_objects::Location& from_here, Task* task, int64 delay_ms, |
252 bool nestable) { | 252 bool nestable) { |
253 task->SetBirthPlace(from_here); | 253 task->SetBirthPlace(from_here); |
254 | 254 |
255 PendingTask pending_task(task, nestable); | 255 PendingTask pending_task(task, nestable); |
256 | 256 |
257 if (delay_ms > 0) { | 257 if (delay_ms > 0) { |
258 pending_task.delayed_run_time = | 258 pending_task.delayed_run_time = |
259 Time::Now() + TimeDelta::FromMilliseconds(delay_ms); | 259 Time::Now() + TimeDelta::FromMilliseconds(delay_ms); |
260 } else { | 260 } else { |
261 DCHECK(delay_ms == 0) << "delay should not be negative"; | 261 DCHECK(delay_ms == 0) << "delay should not be negative"; |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 Watcher *delegate) { | 619 Watcher *delegate) { |
620 return pump_libevent()->WatchFileDescriptor( | 620 return pump_libevent()->WatchFileDescriptor( |
621 fd, | 621 fd, |
622 persistent, | 622 persistent, |
623 static_cast<base::MessagePumpLibevent::Mode>(mode), | 623 static_cast<base::MessagePumpLibevent::Mode>(mode), |
624 controller, | 624 controller, |
625 delegate); | 625 delegate); |
626 } | 626 } |
627 | 627 |
628 #endif | 628 #endif |
OLD | NEW |