Index: base/message_loop/high_priority_task_runner.cc |
diff --git a/base/message_loop/high_priority_task_runner.cc b/base/message_loop/high_priority_task_runner.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..21b4160d640301a31b51c45a98a704ad9cedf1c7 |
--- /dev/null |
+++ b/base/message_loop/high_priority_task_runner.cc |
@@ -0,0 +1,33 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "base/message_loop/high_priority_task_runner.h" |
+ |
+#include "base/logging.h" |
+#include "base/message_loop/incoming_task_queue.h" |
+#include "base/pending_task.h" |
+ |
+namespace base { |
+ |
+HighPriorityTaskRunner::HighPriorityTaskRunner(MessageLoop* message_loop) |
+ : incoming_queue_(new internal::IncomingTaskQueue(message_loop)) { |
+ DCHECK(message_loop); |
+} |
+ |
+HighPriorityTaskRunner::~HighPriorityTaskRunner() { |
+} |
+ |
+void HighPriorityTaskRunner::PostTask( |
+ const tracked_objects::Location& from_here, |
+ const Closure& task) { |
+ incoming_queue_->AddToIncomingQueue( |
+ from_here, task, TimeDelta(), false); |
+} |
+ |
+void HighPriorityTaskRunner::ReloadWorkQueue(TaskQueue* target_work_queue) { |
+ DCHECK(target_work_queue && target_work_queue->empty()); |
+ incoming_queue_->ReloadWorkQueue(target_work_queue); |
+} |
+ |
+} // namespace base |