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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 void MessageLoop::Quit() { | 227 void MessageLoop::Quit() { |
228 DCHECK(current() == this); | 228 DCHECK(current() == this); |
229 if (state_) { | 229 if (state_) { |
230 state_->quit_received = true; | 230 state_->quit_received = true; |
231 } else { | 231 } else { |
232 NOTREACHED() << "Must be inside Run to call Quit"; | 232 NOTREACHED() << "Must be inside Run to call Quit"; |
233 } | 233 } |
234 } | 234 } |
235 | 235 |
| 236 void MessageLoop::QuitNow() { |
| 237 DCHECK(current() == this); |
| 238 if (state_) { |
| 239 pump_->Quit(); |
| 240 } else { |
| 241 NOTREACHED() << "Must be inside Run to call Quit"; |
| 242 } |
| 243 } |
| 244 |
236 void MessageLoop::PostTask( | 245 void MessageLoop::PostTask( |
237 const tracked_objects::Location& from_here, Task* task) { | 246 const tracked_objects::Location& from_here, Task* task) { |
238 PostTask_Helper(from_here, task, 0, true); | 247 PostTask_Helper(from_here, task, 0, true); |
239 } | 248 } |
240 | 249 |
241 void MessageLoop::PostDelayedTask( | 250 void MessageLoop::PostDelayedTask( |
242 const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { | 251 const tracked_objects::Location& from_here, Task* task, int64 delay_ms) { |
243 PostTask_Helper(from_here, task, delay_ms, true); | 252 PostTask_Helper(from_here, task, delay_ms, true); |
244 } | 253 } |
245 | 254 |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 Watcher *delegate) { | 635 Watcher *delegate) { |
627 return pump_libevent()->WatchFileDescriptor( | 636 return pump_libevent()->WatchFileDescriptor( |
628 fd, | 637 fd, |
629 persistent, | 638 persistent, |
630 static_cast<base::MessagePumpLibevent::Mode>(mode), | 639 static_cast<base::MessagePumpLibevent::Mode>(mode), |
631 controller, | 640 controller, |
632 delegate); | 641 delegate); |
633 } | 642 } |
634 | 643 |
635 #endif | 644 #endif |
OLD | NEW |