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

Side by Side Diff: content/child/scheduler/worker_web_scheduler_impl.h

Issue 1088053003: Patch 1/3 to get WebScheduler via WebThread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 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_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ 5 #ifndef CONTENT_CHILD_SCHEDULER_WORKER_WEB_SCHEDULER_IMPL_H_
6 #define CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ 6 #define CONTENT_CHILD_SCHEDULER_WORKER_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"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "third_party/WebKit/public/platform/WebScheduler.h" 12 #include "third_party/WebKit/public/platform/WebScheduler.h"
13 #include "third_party/WebKit/public/platform/WebThread.h" 13 #include "third_party/WebKit/public/platform/WebThread.h"
14 14
15 namespace base { 15 namespace base {
16 class SingleThreadTaskRunner; 16 class SingleThreadTaskRunner;
17 } 17 }
18 18
19 namespace content { 19 namespace content {
20 20
21 class RendererScheduler; 21 class WorkerScheduler;
22 class SingleThreadIdleTaskRunner; 22 class SingleThreadIdleTaskRunner;
23 23
24 class CONTENT_EXPORT WebSchedulerImpl : public blink::WebScheduler { 24 class CONTENT_EXPORT WorkerWebSchedulerImpl : public blink::WebScheduler {
25 public: 25 public:
26 WebSchedulerImpl(RendererScheduler* renderer_scheduler); 26 explicit WorkerWebSchedulerImpl(WorkerScheduler* worker_scheduler);
27 ~WebSchedulerImpl() override; 27 ~WorkerWebSchedulerImpl() override;
28 28
29 virtual bool shouldYieldForHighPriorityWork(); 29 virtual bool shouldYieldForHighPriorityWork();
30 virtual bool canExceedIdleDeadlineIfRequired(); 30 virtual bool canExceedIdleDeadlineIfRequired();
31 virtual void postIdleTask(const blink::WebTraceLocation& location, 31 virtual void postIdleTask(const blink::WebTraceLocation& location,
32 blink::WebThread::IdleTask* task); 32 blink::WebThread::IdleTask* task);
33 virtual void postNonNestableIdleTask(const blink::WebTraceLocation& location, 33 virtual void postNonNestableIdleTask(const blink::WebTraceLocation& location,
34 blink::WebThread::IdleTask* task); 34 blink::WebThread::IdleTask* task);
35 virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location, 35 virtual void postIdleTaskAfterWakeup(const blink::WebTraceLocation& location,
36 blink::WebThread::IdleTask* task); 36 blink::WebThread::IdleTask* task);
37 virtual void postLoadingTask(const blink::WebTraceLocation& location, 37 virtual void postLoadingTask(const blink::WebTraceLocation& location,
38 blink::WebThread::Task* task); 38 blink::WebThread::Task* task);
39 virtual void postTimerTask(const blink::WebTraceLocation& location, 39 virtual void postTimerTask(const blink::WebTraceLocation& location,
40 blink::WebThread::Task* task, 40 blink::WebThread::Task* task,
41 long long delayMs); 41 long long delayMs);
42 42
43 private: 43 private:
44 static void runIdleTask(scoped_ptr<blink::WebThread::IdleTask> task, 44 static void runIdleTask(scoped_ptr<blink::WebThread::IdleTask> task,
45 base::TimeTicks deadline); 45 base::TimeTicks deadline);
46 static void runTask(scoped_ptr<blink::WebThread::Task> task); 46 static void runTask(scoped_ptr<blink::WebThread::Task> task);
47 47
48 RendererScheduler* renderer_scheduler_; 48 WorkerScheduler* worker_scheduler_; // NOT OWNED
49 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; 49 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_;
50 scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_; 50 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
51 scoped_refptr<base::SingleThreadTaskRunner> timer_task_runner_;
52 }; 51 };
53 52
54 } // namespace content 53 } // namespace content
55 54
56 #endif // CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ 55 #endif // CONTENT_CHILD_SCHEDULER_WORKER_WEB_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698