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

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

Issue 664963002: content: Add RendererScheduler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Even moar tests, add a null scheduler and follow review. Created 6 years, 1 month 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
(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_RENDERER_SCHEDULER_H_
6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_
7
8 #include "base/atomicops.h"
9 #include "base/synchronization/lock.h"
10 #include "base/threading/thread_checker.h"
11 #include "content/renderer/scheduler/single_thread_idle_task_runner.h"
12 #include "content/renderer/scheduler/task_queue_manager.h"
13
14 namespace cc {
15 struct BeginFrameArgs;
16 }
17
18 namespace content {
19
20 class CONTENT_EXPORT RendererScheduler {
21 public:
22 virtual ~RendererScheduler();
23 static scoped_ptr<RendererScheduler> Create();
24
25 // Returns the default task runner.
26 virtual scoped_refptr<base::SingleThreadTaskRunner> DefaultTaskRunner() = 0;
27
28 // Returns the compositor task runner.
29 virtual scoped_refptr<base::SingleThreadTaskRunner>
30 CompositorTaskRunner() = 0;
31
32 // Returns the idle task runner. Tasks posted to this runner may be reordered
33 // relative to other task types and may be starved for an arbitrarily long
34 // time if no idle time is available.
35 virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0;
36
37 // Called to notify about the start of a new frame. Must be called from the
38 // main thread.
39 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0;
40
41 // Called to notify that a previously begun frame was committed. Must be
42 // called from the main thread.
43 virtual void DidCommitFrameToCompositor() = 0;
44
45 // Tells the scheduler that the system received an input event. Can be called
46 // on any thread.
47 virtual void DidReceiveInputEvent() = 0;
48
49 // Returns true if there is high priority work pending on the main thread
50 // and the caller should yield to let the scheduler service that work.
51 // Must be called from the main thread.
52 virtual bool ShouldYieldForHighPriorityWork() = 0;
53
54 protected:
55 RendererScheduler();
56 DISALLOW_COPY_AND_ASSIGN(RendererScheduler);
57 };
58
59 } // namespace content
60
61 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698