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

Unified Diff: components/scheduler/child/web_task_runner_impl.cc

Issue 1675633002: WebTaskRunnerImpl to take a TaskQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 10 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
Index: components/scheduler/child/web_task_runner_impl.cc
diff --git a/components/scheduler/child/web_task_runner_impl.cc b/components/scheduler/child/web_task_runner_impl.cc
index 6b1ec23a6d38a8c5c849822b527701016e975145..49b5133b9ab033ba545844c97b00628226727521 100644
--- a/components/scheduler/child/web_task_runner_impl.cc
+++ b/components/scheduler/child/web_task_runner_impl.cc
@@ -6,14 +6,13 @@
#include "base/bind.h"
#include "base/location.h"
-#include "base/single_thread_task_runner.h"
+#include "components/scheduler/base/task_queue.h"
#include "third_party/WebKit/public/platform/WebTraceLocation.h"
namespace scheduler {
-WebTaskRunnerImpl::WebTaskRunnerImpl(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner)
- : task_runner_(task_runner) {}
+WebTaskRunnerImpl::WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue)
+ : task_queue_(task_queue) {}
WebTaskRunnerImpl::~WebTaskRunnerImpl() {}
@@ -21,7 +20,7 @@ void WebTaskRunnerImpl::postTask(const blink::WebTraceLocation& web_location,
blink::WebTaskRunner::Task* task) {
tracked_objects::Location location(web_location.functionName(),
web_location.fileName(), -1, nullptr);
- task_runner_->PostTask(
+ task_queue_->PostTask(
location,
base::Bind(&WebTaskRunnerImpl::runTask,
base::Passed(scoped_ptr<blink::WebTaskRunner::Task>(task))));
@@ -34,7 +33,7 @@ void WebTaskRunnerImpl::postDelayedTask(
DCHECK_GE(delayMs, 0.0);
tracked_objects::Location location(web_location.functionName(),
web_location.fileName(), -1, nullptr);
- task_runner_->PostDelayedTask(
+ task_queue_->PostDelayedTask(
location,
base::Bind(&WebTaskRunnerImpl::runTask,
base::Passed(scoped_ptr<blink::WebTaskRunner::Task>(task))),
@@ -42,7 +41,7 @@ void WebTaskRunnerImpl::postDelayedTask(
}
blink::WebTaskRunner* WebTaskRunnerImpl::clone() {
- return new WebTaskRunnerImpl(task_runner_);
+ return new WebTaskRunnerImpl(task_queue_);
}
void WebTaskRunnerImpl::runTask(scoped_ptr<blink::WebTaskRunner::Task> task)
« no previous file with comments | « components/scheduler/child/web_task_runner_impl.h ('k') | components/scheduler/child/webthread_impl_for_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698