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

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

Issue 1977863004: scheduler: Add main thread gesture as a detected use case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken test Created 4 years, 7 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 | components/scheduler/renderer/renderer_scheduler.cc » ('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 COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_
6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ 6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 27 matching lines...) Expand all
38 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler { 38 class SCHEDULER_EXPORT RendererScheduler : public ChildScheduler {
39 public: 39 public:
40 ~RendererScheduler() override; 40 ~RendererScheduler() override;
41 static std::unique_ptr<RendererScheduler> Create(); 41 static std::unique_ptr<RendererScheduler> Create();
42 42
43 // Returns the compositor task runner. 43 // Returns the compositor task runner.
44 virtual scoped_refptr<TaskQueue> CompositorTaskRunner() = 0; 44 virtual scoped_refptr<TaskQueue> CompositorTaskRunner() = 0;
45 45
46 // Keep RendererScheduler::UseCaseToString in sync with this enum. 46 // Keep RendererScheduler::UseCaseToString in sync with this enum.
47 enum class UseCase { 47 enum class UseCase {
48 // No active use case detected.
48 NONE, 49 NONE,
50 // A continuous gesture (e.g., scroll, pinch) which is being driven by the
51 // compositor thread.
49 COMPOSITOR_GESTURE, 52 COMPOSITOR_GESTURE,
53 // An unspecified touch gesture which is being handled by the main thread.
54 // Note that since we don't have a full view of the use case, we should be
55 // careful to prioritize all work equally.
56 MAIN_THREAD_CUSTOM_INPUT_HANDLING,
57 // A continuous gesture (e.g., scroll, pinch) which is being driven by the
58 // compositor thread but also observed by the main thread. An example is
59 // synchronized scrolling where a scroll listener on the main thread changes
60 // page layout based on the current scroll position.
61 SYNCHRONIZED_GESTURE,
62 // A gesture has recently started and we are about to run main thread touch
63 // listeners to find out the actual gesture type. To minimize touch latency,
64 // only input handling work should run in this state.
65 TOUCHSTART,
66 // The page is loading.
67 LOADING,
68 // A continuous gesture (e.g., scroll) which is being handled by the main
69 // thread.
50 MAIN_THREAD_GESTURE, 70 MAIN_THREAD_GESTURE,
51 SYNCHRONIZED_GESTURE, // Both threads in the critical path.
52 TOUCHSTART,
53 LOADING,
54 // Must be the last entry. 71 // Must be the last entry.
55 USE_CASE_COUNT, 72 USE_CASE_COUNT,
56 FIRST_USE_CASE = NONE, 73 FIRST_USE_CASE = NONE,
57 }; 74 };
58 static const char* UseCaseToString(UseCase use_case); 75 static const char* UseCaseToString(UseCase use_case);
59 76
60 // Creates a WebThread implementation for the renderer main thread. 77 // Creates a WebThread implementation for the renderer main thread.
61 virtual std::unique_ptr<blink::WebThread> CreateMainThread() = 0; 78 virtual std::unique_ptr<blink::WebThread> CreateMainThread() = 0;
62 79
63 // Returns the loading task runner. This queue is intended for tasks related 80 // Returns the loading task runner. This queue is intended for tasks related
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 base::trace_event::BlameContext* blame_context) = 0; 192 base::trace_event::BlameContext* blame_context) = 0;
176 193
177 protected: 194 protected:
178 RendererScheduler(); 195 RendererScheduler();
179 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); 196 DISALLOW_COPY_AND_ASSIGN(RendererScheduler);
180 }; 197 };
181 198
182 } // namespace scheduler 199 } // namespace scheduler
183 200
184 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ 201 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/renderer/renderer_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698