OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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 #ifndef CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time/time.h" |
| 11 #include "third_party/WebKit/public/platform/WebScheduler.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 class RendererScheduler; |
| 16 class SingleThreadIdleTaskRunner; |
| 17 |
| 18 class WebSchedulerImpl : public blink::WebScheduler { |
| 19 public: |
| 20 WebSchedulerImpl(RendererScheduler* renderer_scheduler); |
| 21 ~WebSchedulerImpl() override; |
| 22 |
| 23 virtual bool shouldYieldForHighPriorityWork(); |
| 24 virtual void postIdleTask(const blink::WebTraceLocation& location, |
| 25 blink::WebScheduler::IdleTask* task); |
| 26 virtual void shutdown(); |
| 27 |
| 28 private: |
| 29 static void runIdleTask(scoped_ptr<blink::WebScheduler::IdleTask> task, |
| 30 base::TimeTicks deadline); |
| 31 |
| 32 RendererScheduler* renderer_scheduler_; |
| 33 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; |
| 34 }; |
| 35 |
| 36 } // namespace content |
| 37 |
| 38 #endif // CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ |
OLD | NEW |