| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2016 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 "components/scheduler/child/compositor_worker_scheduler.h" | 
|  | 6 | 
|  | 7 #include "base/message_loop/message_loop.h" | 
|  | 8 #include "base/threading/thread.h" | 
|  | 9 | 
|  | 10 namespace scheduler { | 
|  | 11 | 
|  | 12 CompositorWorkerScheduler::CompositorWorkerScheduler(base::Thread* thread) | 
|  | 13     : thread_(thread) {} | 
|  | 14 | 
|  | 15 CompositorWorkerScheduler::~CompositorWorkerScheduler() {} | 
|  | 16 | 
|  | 17 void CompositorWorkerScheduler::Init() {} | 
|  | 18 | 
|  | 19 scoped_refptr<base::SingleThreadTaskRunner> | 
|  | 20 CompositorWorkerScheduler::DefaultTaskRunner() { | 
|  | 21   // TODO(sad): Implement a more robust scheduler that can do idle tasks for GC | 
|  | 22   // without regressing performance of the rest of the system. | 
|  | 23   return thread_->task_runner(); | 
|  | 24 } | 
|  | 25 | 
|  | 26 scoped_refptr<scheduler::SingleThreadIdleTaskRunner> | 
|  | 27 CompositorWorkerScheduler::IdleTaskRunner() { | 
|  | 28   // TODO(sad): Not having a task-runner for idle tasks means v8 has to fallback | 
|  | 29   // to inline GC, which might cause jank. | 
|  | 30   return nullptr; | 
|  | 31 } | 
|  | 32 | 
|  | 33 bool CompositorWorkerScheduler::CanExceedIdleDeadlineIfRequired() const { | 
|  | 34   return false; | 
|  | 35 } | 
|  | 36 | 
|  | 37 bool CompositorWorkerScheduler::ShouldYieldForHighPriorityWork() { | 
|  | 38   return false; | 
|  | 39 } | 
|  | 40 | 
|  | 41 void CompositorWorkerScheduler::AddTaskObserver( | 
|  | 42     base::MessageLoop::TaskObserver* task_observer) { | 
|  | 43   thread_->message_loop()->AddTaskObserver(task_observer); | 
|  | 44 } | 
|  | 45 | 
|  | 46 void CompositorWorkerScheduler::RemoveTaskObserver( | 
|  | 47     base::MessageLoop::TaskObserver* task_observer) { | 
|  | 48   thread_->message_loop()->RemoveTaskObserver(task_observer); | 
|  | 49 } | 
|  | 50 | 
|  | 51 void CompositorWorkerScheduler::Shutdown() {} | 
|  | 52 | 
|  | 53 }  // namespace scheduler | 
| OLD | NEW | 
|---|