Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1119)

Unified Diff: base/message_loop/high_priority_task_runner.cc

Issue 281073002: NOT FOR REVIEW: Adding prioritized incoming task queue to renderers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Prioritize input events Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/message_loop/high_priority_task_runner.h ('k') | base/message_loop/message_loop.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « base/message_loop/high_priority_task_runner.h ('k') | base/message_loop/message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698