OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ | 5 #ifndef CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ |
6 #define CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ | 6 #define CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // blink::WebScheduler implementation: | 35 // blink::WebScheduler implementation: |
36 virtual void shutdown(); | 36 virtual void shutdown(); |
37 virtual bool shouldYieldForHighPriorityWork(); | 37 virtual bool shouldYieldForHighPriorityWork(); |
38 virtual bool canExceedIdleDeadlineIfRequired(); | 38 virtual bool canExceedIdleDeadlineIfRequired(); |
39 virtual void postIdleTask(const blink::WebTraceLocation& location, | 39 virtual void postIdleTask(const blink::WebTraceLocation& location, |
40 blink::WebThread::IdleTask* task); | 40 blink::WebThread::IdleTask* task); |
41 virtual void postNonNestableIdleTask(const blink::WebTraceLocation& location, | 41 virtual void postNonNestableIdleTask(const blink::WebTraceLocation& location, |
42 blink::WebThread::IdleTask* task); | 42 blink::WebThread::IdleTask* task); |
43 virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location, | 43 virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location, |
44 blink::WebThread::IdleTask* task); | 44 blink::WebThread::IdleTask* task); |
45 // TODO(alexclarke): Remove this. | |
46 virtual void postLoadingTask(const blink::WebTraceLocation& location, | |
47 blink::WebThread::Task* task); | |
48 virtual blink::WebTaskRunner* loadingTaskRunner(); | 45 virtual blink::WebTaskRunner* loadingTaskRunner(); |
49 virtual blink::WebTaskRunner* timerTaskRunner(); | 46 virtual blink::WebTaskRunner* timerTaskRunner(); |
50 | 47 |
51 // TODO(alexclarke): Remove when possible. | 48 // TODO(alexclarke): Remove when possible. |
52 virtual void postTimerTaskAt(const blink::WebTraceLocation& location, | 49 virtual void postTimerTaskAt(const blink::WebTraceLocation& location, |
53 blink::WebThread::Task* task, | |
54 double monotonicTime); | |
55 // TODO(alexclarke): Remove when possible. | |
56 virtual void postTimerTaskAt(const blink::WebTraceLocation& location, | |
57 blink::WebTaskRunner::Task* task, | 50 blink::WebTaskRunner::Task* task, |
58 double monotonicTime); | 51 double monotonicTime); |
59 // TODO(alexclarke): Remove this. | |
60 virtual void postTimerTask(const blink::WebTraceLocation& location, | |
61 blink::WebThread::Task* task, | |
62 double delaySecs); | |
63 // TODO(alexclarke): Remove this. | |
64 virtual void postTimerTask(const blink::WebTraceLocation& location, | |
65 blink::WebThread::Task* task, | |
66 long long delayMs); | |
67 | 52 |
68 private: | 53 private: |
69 static void runIdleTask(scoped_ptr<blink::WebThread::IdleTask> task, | 54 static void runIdleTask(scoped_ptr<blink::WebThread::IdleTask> task, |
70 base::TimeTicks deadline); | 55 base::TimeTicks deadline); |
71 static void runTask(scoped_ptr<blink::WebThread::Task> task); | |
72 | 56 |
73 ChildScheduler* child_scheduler_; // NOT OWNED | 57 ChildScheduler* child_scheduler_; // NOT OWNED |
74 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; | 58 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; |
75 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; | |
76 scoped_refptr<TaskQueue> timer_task_runner_; | 59 scoped_refptr<TaskQueue> timer_task_runner_; |
77 scoped_ptr<WebTaskRunnerImpl> loading_web_task_runner_; | 60 scoped_ptr<WebTaskRunnerImpl> loading_web_task_runner_; |
78 scoped_ptr<WebTaskRunnerImpl> timer_web_task_runner_; | 61 scoped_ptr<WebTaskRunnerImpl> timer_web_task_runner_; |
79 }; | 62 }; |
80 | 63 |
81 } // namespace scheduler | 64 } // namespace scheduler |
82 | 65 |
83 #endif // CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ | 66 #endif // CONTENT_CHILD_SCHEDULER_BASE_WEB_SCHEDULER_IMPL_H_ |
OLD | NEW |