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

Unified Diff: content/child/scheduler/web_scheduler_impl.cc

Issue 1058873010: Move blink scheduler implementation into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 5 years, 8 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: content/child/scheduler/web_scheduler_impl.cc
diff --git a/content/child/scheduler/web_scheduler_impl.cc b/content/child/scheduler/web_scheduler_impl.cc
deleted file mode 100644
index 25772f853e8530d4abc3604bb54e9f0a9f2cf7a7..0000000000000000000000000000000000000000
--- a/content/child/scheduler/web_scheduler_impl.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2015 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 "content/child/scheduler/web_scheduler_impl.h"
-
-#include "base/bind.h"
-#include "base/single_thread_task_runner.h"
-#include "content/child/scheduler/worker_scheduler.h"
-#include "third_party/WebKit/public/platform/WebTraceLocation.h"
-
-namespace content {
-
-WebSchedulerImpl::WebSchedulerImpl(
- ChildScheduler* child_scheduler,
- scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner,
- scoped_refptr<base::SingleThreadTaskRunner> timer_task_runner)
- : child_scheduler_(child_scheduler),
- idle_task_runner_(idle_task_runner),
- loading_task_runner_(loading_task_runner),
- timer_task_runner_(timer_task_runner) {
-}
-
-WebSchedulerImpl::~WebSchedulerImpl() {
-}
-
-bool WebSchedulerImpl::shouldYieldForHighPriorityWork() {
- return child_scheduler_->ShouldYieldForHighPriorityWork();
-}
-
-bool WebSchedulerImpl::canExceedIdleDeadlineIfRequired() {
- return child_scheduler_->CanExceedIdleDeadlineIfRequired();
-}
-
-void WebSchedulerImpl::runIdleTask(scoped_ptr<blink::WebThread::IdleTask> task,
- base::TimeTicks deadline) {
- task->run((deadline - base::TimeTicks()).InSecondsF());
-}
-
-void WebSchedulerImpl::runTask(scoped_ptr<blink::WebThread::Task> task) {
- task->run();
-}
-
-void WebSchedulerImpl::postIdleTask(const blink::WebTraceLocation& web_location,
- blink::WebThread::IdleTask* task) {
- DCHECK(idle_task_runner_);
- scoped_ptr<blink::WebThread::IdleTask> scoped_task(task);
- tracked_objects::Location location(web_location.functionName(),
- web_location.fileName(), -1, nullptr);
- idle_task_runner_->PostIdleTask(
- location,
- base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
-}
-
-void WebSchedulerImpl::postNonNestableIdleTask(
- const blink::WebTraceLocation& web_location,
- blink::WebThread::IdleTask* task) {
- DCHECK(idle_task_runner_);
- scoped_ptr<blink::WebThread::IdleTask> scoped_task(task);
- tracked_objects::Location location(web_location.functionName(),
- web_location.fileName(), -1, nullptr);
- idle_task_runner_->PostNonNestableIdleTask(
- location,
- base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
-}
-
-void WebSchedulerImpl::postIdleTaskAfterWakeup(
- const blink::WebTraceLocation& web_location,
- blink::WebThread::IdleTask* task) {
- DCHECK(idle_task_runner_);
- scoped_ptr<blink::WebThread::IdleTask> scoped_task(task);
- tracked_objects::Location location(web_location.functionName(),
- web_location.fileName(), -1, nullptr);
- idle_task_runner_->PostIdleTaskAfterWakeup(
- location,
- base::Bind(&WebSchedulerImpl::runIdleTask, base::Passed(&scoped_task)));
-}
-
-void WebSchedulerImpl::postLoadingTask(
- const blink::WebTraceLocation& web_location,
- blink::WebThread::Task* task) {
- DCHECK(loading_task_runner_);
- scoped_ptr<blink::WebThread::Task> scoped_task(task);
- tracked_objects::Location location(web_location.functionName(),
- web_location.fileName(), -1, nullptr);
- loading_task_runner_->PostTask(
- location,
- base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task)));
-}
-
-void WebSchedulerImpl::postTimerTask(
- const blink::WebTraceLocation& web_location,
- blink::WebThread::Task* task,
- long long delayMs) {
- DCHECK(timer_task_runner_);
- scoped_ptr<blink::WebThread::Task> scoped_task(task);
- tracked_objects::Location location(web_location.functionName(),
- web_location.fileName(), -1, nullptr);
- timer_task_runner_->PostDelayedTask(
- location,
- base::Bind(&WebSchedulerImpl::runTask, base::Passed(&scoped_task)),
- base::TimeDelta::FromMilliseconds(delayMs));
-}
-
-} // namespace content
« no previous file with comments | « content/child/scheduler/web_scheduler_impl.h ('k') | content/child/scheduler/webthread_impl_for_worker_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698