ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / renderer / scheduler / web_scheduler_impl.h
blobe209c367c6257e7d20eb33aaaf7738297a61b3aa
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.
5 #ifndef CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_
6 #define CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h"
11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebScheduler.h"
13 #include "third_party/WebKit/public/platform/WebThread.h"
15 namespace base {
16 class SingleThreadTaskRunner;
19 namespace content {
21 class RendererScheduler;
22 class SingleThreadIdleTaskRunner;
24 class CONTENT_EXPORT WebSchedulerImpl : public blink::WebScheduler {
25 public:
26 WebSchedulerImpl(RendererScheduler* renderer_scheduler);
27 ~WebSchedulerImpl() override;
29 virtual bool shouldYieldForHighPriorityWork();
30 virtual void postIdleTask(const blink::WebTraceLocation& location,
31 blink::WebScheduler::IdleTask* task);
32 virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location,
33 blink::WebScheduler::IdleTask* task);
34 virtual void postLoadingTask(const blink::WebTraceLocation& location,
35 blink::WebThread::Task* task);
36 virtual void shutdown();
38 private:
39 static void runIdleTask(scoped_ptr<blink::WebScheduler::IdleTask> task,
40 base::TimeTicks deadline);
41 static void runTask(scoped_ptr<blink::WebThread::Task> task);
43 RendererScheduler* renderer_scheduler_;
44 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_;
45 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_;
48 } // namespace content
50 #endif // CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_