OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/message_loop/high_priority_task_runner.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "base/message_loop/incoming_task_queue.h" |
| 9 #include "base/pending_task.h" |
| 10 |
| 11 namespace base { |
| 12 |
| 13 HighPriorityTaskRunner::HighPriorityTaskRunner(MessageLoop* message_loop) |
| 14 : incoming_queue_(new internal::IncomingTaskQueue(message_loop)) { |
| 15 DCHECK(message_loop); |
| 16 } |
| 17 |
| 18 HighPriorityTaskRunner::~HighPriorityTaskRunner() { |
| 19 } |
| 20 |
| 21 void HighPriorityTaskRunner::PostTask( |
| 22 const tracked_objects::Location& from_here, |
| 23 const Closure& task) { |
| 24 incoming_queue_->AddToIncomingQueue( |
| 25 from_here, task, TimeDelta(), false); |
| 26 } |
| 27 |
| 28 void HighPriorityTaskRunner::ReloadWorkQueue(TaskQueue* target_work_queue) { |
| 29 DCHECK(target_work_queue && target_work_queue->empty()); |
| 30 incoming_queue_->ReloadWorkQueue(target_work_queue); |
| 31 } |
| 32 |
| 33 } // namespace base |
OLD | NEW |