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

Side by Side Diff: content/renderer/scheduler/web_scheduler_impl.h

Issue 878413002: Wire the scheduler up in TestBlinkWebUnitTestSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lazily create the WebSchedulerImpl and RendererScheduler if needed Created 5 years, 10 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
« no previous file with comments | « no previous file | content/test/test_blink_web_unit_test_support.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_
6 #define CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ 6 #define CONTENT_RENDERER_SCHEDULER_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 "third_party/WebKit/public/platform/WebScheduler.h" 12 #include "third_party/WebKit/public/platform/WebScheduler.h"
12 #include "third_party/WebKit/public/platform/WebThread.h" 13 #include "third_party/WebKit/public/platform/WebThread.h"
13 14
14 namespace content { 15 namespace content {
15 16
16 class RendererScheduler; 17 class RendererScheduler;
17 class SingleThreadIdleTaskRunner; 18 class SingleThreadIdleTaskRunner;
18 19
19 class WebSchedulerImpl : public blink::WebScheduler { 20 class CONTENT_EXPORT WebSchedulerImpl : public blink::WebScheduler {
20 public: 21 public:
21 WebSchedulerImpl(RendererScheduler* renderer_scheduler); 22 WebSchedulerImpl(RendererScheduler* renderer_scheduler);
22 ~WebSchedulerImpl() override; 23 ~WebSchedulerImpl() override;
23 24
24 virtual bool shouldYieldForHighPriorityWork(); 25 virtual bool shouldYieldForHighPriorityWork();
25 virtual void postIdleTask(const blink::WebTraceLocation& location, 26 virtual void postIdleTask(const blink::WebTraceLocation& location,
26 blink::WebScheduler::IdleTask* task); 27 blink::WebScheduler::IdleTask* task);
27 virtual void postLoadingTask(const blink::WebTraceLocation& location, 28 virtual void postLoadingTask(const blink::WebTraceLocation& location,
28 blink::WebThread::Task* task); 29 blink::WebThread::Task* task);
29 virtual void shutdown(); 30 virtual void shutdown();
30 31
31 private: 32 private:
32 static void runIdleTask(scoped_ptr<blink::WebScheduler::IdleTask> task, 33 static void runIdleTask(scoped_ptr<blink::WebScheduler::IdleTask> task,
33 base::TimeTicks deadline); 34 base::TimeTicks deadline);
34 static void runTask(scoped_ptr<blink::WebThread::Task> task); 35 static void runTask(scoped_ptr<blink::WebThread::Task> task);
35 36
36 RendererScheduler* renderer_scheduler_; 37 RendererScheduler* renderer_scheduler_;
37 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_; 38 scoped_refptr<SingleThreadIdleTaskRunner> idle_task_runner_;
38 }; 39 };
39 40
40 } // namespace content 41 } // namespace content
41 42
42 #endif // CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_ 43 #endif // CONTENT_RENDERER_SCHEDULER_WEB_SCHEDULER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/test/test_blink_web_unit_test_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698