| Index: base/message_loop/incoming_task_queue.cc
|
| diff --git a/base/message_loop/incoming_task_queue.cc b/base/message_loop/incoming_task_queue.cc
|
| index 5e9a4613da1cad2a28369aa78b69e87001ad9e9f..c1ce939b0c4708ac431d80b54a35ee8ef73b314c 100644
|
| --- a/base/message_loop/incoming_task_queue.cc
|
| +++ b/base/message_loop/incoming_task_queue.cc
|
| @@ -44,8 +44,7 @@
|
| message_loop_(message_loop),
|
| next_sequence_num_(0),
|
| message_loop_scheduled_(false),
|
| - always_schedule_work_(AlwaysNotifyPump(message_loop_->type())),
|
| - is_ready_for_scheduling_(false) {
|
| + always_schedule_work_(AlwaysNotifyPump(message_loop_->type())) {
|
| }
|
|
|
| bool IncomingTaskQueue::AddToIncomingQueue(
|
| @@ -110,15 +109,6 @@
|
| message_loop_ = NULL;
|
| }
|
|
|
| -void IncomingTaskQueue::StartScheduling() {
|
| - AutoLock lock(incoming_queue_lock_);
|
| - DCHECK(!is_ready_for_scheduling_);
|
| - DCHECK(!message_loop_scheduled_);
|
| - is_ready_for_scheduling_ = true;
|
| - if (!incoming_queue_.empty())
|
| - ScheduleWork();
|
| -}
|
| -
|
| IncomingTaskQueue::~IncomingTaskQueue() {
|
| // Verify that WillDestroyCurrentMessageLoop() has been called.
|
| DCHECK(!message_loop_);
|
| @@ -158,25 +148,19 @@
|
| incoming_queue_.push(*pending_task);
|
| pending_task->task.Reset();
|
|
|
| - if (is_ready_for_scheduling_ &&
|
| - (always_schedule_work_ || (!message_loop_scheduled_ && was_empty))) {
|
| - ScheduleWork();
|
| + if (always_schedule_work_ || (!message_loop_scheduled_ && was_empty)) {
|
| + // Wake up the message loop.
|
| + message_loop_->ScheduleWork();
|
| + // After we've scheduled the message loop, we do not need to do so again
|
| + // until we know it has processed all of the work in our queue and is
|
| + // waiting for more work again. The message loop will always attempt to
|
| + // reload from the incoming queue before waiting again so we clear this flag
|
| + // in ReloadWorkQueue().
|
| + message_loop_scheduled_ = true;
|
| }
|
|
|
| return true;
|
| }
|
|
|
| -void IncomingTaskQueue::ScheduleWork() {
|
| - DCHECK(is_ready_for_scheduling_);
|
| - // Wake up the message loop.
|
| - message_loop_->ScheduleWork();
|
| - // After we've scheduled the message loop, we do not need to do so again
|
| - // until we know it has processed all of the work in our queue and is
|
| - // waiting for more work again. The message loop will always attempt to
|
| - // reload from the incoming queue before waiting again so we clear this flag
|
| - // in ReloadWorkQueue().
|
| - message_loop_scheduled_ = true;
|
| -}
|
| -
|
| } // namespace internal
|
| } // namespace base
|
|
|