| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 411 } |
| 412 | 412 |
| 413 bool MessageLoop::DeferOrRunPendingTask(PendingTask pending_task) { | 413 bool MessageLoop::DeferOrRunPendingTask(PendingTask pending_task) { |
| 414 if (pending_task.nestable || !is_nested_) { | 414 if (pending_task.nestable || !is_nested_) { |
| 415 RunTask(&pending_task); | 415 RunTask(&pending_task); |
| 416 // Show that we ran a task (Note: a new one might arrive as a | 416 // Show that we ran a task (Note: a new one might arrive as a |
| 417 // consequence!). | 417 // consequence!). |
| 418 return true; | 418 return true; |
| 419 } | 419 } |
| 420 | 420 |
| 421 // We couldn't run the task now because we're in a nested message loop | 421 // We couldn't run the task now because we're in a nested run loop |
| 422 // and the task isn't nestable. | 422 // and the task isn't nestable. |
| 423 deferred_non_nestable_work_queue_.push(std::move(pending_task)); | 423 deferred_non_nestable_work_queue_.push(std::move(pending_task)); |
| 424 return false; | 424 return false; |
| 425 } | 425 } |
| 426 | 426 |
| 427 void MessageLoop::AddToDelayedWorkQueue(PendingTask pending_task) { | 427 void MessageLoop::AddToDelayedWorkQueue(PendingTask pending_task) { |
| 428 // Move to the delayed work queue. | 428 // Move to the delayed work queue. |
| 429 delayed_work_queue_.push(std::move(pending_task)); | 429 delayed_work_queue_.push(std::move(pending_task)); |
| 430 } | 430 } |
| 431 | 431 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 persistent, | 642 persistent, |
| 643 mode, | 643 mode, |
| 644 controller, | 644 controller, |
| 645 delegate); | 645 delegate); |
| 646 } | 646 } |
| 647 #endif | 647 #endif |
| 648 | 648 |
| 649 #endif // !defined(OS_NACL_SFI) | 649 #endif // !defined(OS_NACL_SFI) |
| 650 | 650 |
| 651 } // namespace base | 651 } // namespace base |
| OLD | NEW |