| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 | 347 |
| 348 void MessageLoop::QuitNow() { | 348 void MessageLoop::QuitNow() { |
| 349 DCHECK_EQ(this, current()); | 349 DCHECK_EQ(this, current()); |
| 350 if (state_) { | 350 if (state_) { |
| 351 pump_->Quit(); | 351 pump_->Quit(); |
| 352 } else { | 352 } else { |
| 353 NOTREACHED() << "Must be inside Run to call Quit"; | 353 NOTREACHED() << "Must be inside Run to call Quit"; |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 void MessageLoop::CancelQuit() { |
| 358 DCHECK_EQ(this, current()); |
| 359 if (state_) |
| 360 state_->quit_received = false; |
| 361 } |
| 362 |
| 357 void MessageLoop::SetNestableTasksAllowed(bool allowed) { | 363 void MessageLoop::SetNestableTasksAllowed(bool allowed) { |
| 358 if (nestable_tasks_allowed_ != allowed) { | 364 if (nestable_tasks_allowed_ != allowed) { |
| 359 nestable_tasks_allowed_ = allowed; | 365 nestable_tasks_allowed_ = allowed; |
| 360 if (!nestable_tasks_allowed_) | 366 if (!nestable_tasks_allowed_) |
| 361 return; | 367 return; |
| 362 // Start the native pump if we are not already pumping. | 368 // Start the native pump if we are not already pumping. |
| 363 pump_->ScheduleWork(); | 369 pump_->ScheduleWork(); |
| 364 } | 370 } |
| 365 } | 371 } |
| 366 | 372 |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 Watcher *delegate) { | 843 Watcher *delegate) { |
| 838 return pump_libevent()->WatchFileDescriptor( | 844 return pump_libevent()->WatchFileDescriptor( |
| 839 fd, | 845 fd, |
| 840 persistent, | 846 persistent, |
| 841 static_cast<base::MessagePumpLibevent::Mode>(mode), | 847 static_cast<base::MessagePumpLibevent::Mode>(mode), |
| 842 controller, | 848 controller, |
| 843 delegate); | 849 delegate); |
| 844 } | 850 } |
| 845 | 851 |
| 846 #endif | 852 #endif |
| OLD | NEW |