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

Side by Side Diff: cc/scheduler/scheduler.h

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 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
« no previous file with comments | « cc/scheduler/delay_based_time_source_unittest.cc ('k') | cc/scheduler/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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 CC_SCHEDULER_SCHEDULER_H_ 5 #ifndef CC_SCHEDULER_SCHEDULER_H_
6 #define CC_SCHEDULER_SCHEDULER_H_ 6 #define CC_SCHEDULER_SCHEDULER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory>
9 #include <string> 10 #include <string>
10 11
11 #include "base/cancelable_callback.h" 12 #include "base/cancelable_callback.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/time.h" 14 #include "base/time/time.h"
15 #include "cc/base/cc_export.h" 15 #include "cc/base/cc_export.h"
16 #include "cc/output/begin_frame_args.h" 16 #include "cc/output/begin_frame_args.h"
17 #include "cc/scheduler/begin_frame_source.h" 17 #include "cc/scheduler/begin_frame_source.h"
18 #include "cc/scheduler/begin_frame_tracker.h" 18 #include "cc/scheduler/begin_frame_tracker.h"
19 #include "cc/scheduler/delay_based_time_source.h" 19 #include "cc/scheduler/delay_based_time_source.h"
20 #include "cc/scheduler/draw_result.h" 20 #include "cc/scheduler/draw_result.h"
21 #include "cc/scheduler/scheduler_settings.h" 21 #include "cc/scheduler/scheduler_settings.h"
22 #include "cc/scheduler/scheduler_state_machine.h" 22 #include "cc/scheduler/scheduler_state_machine.h"
23 #include "cc/tiles/tile_priority.h" 23 #include "cc/tiles/tile_priority.h"
(...skipping 24 matching lines...) Expand all
48 virtual void DidFinishImplFrame() = 0; 48 virtual void DidFinishImplFrame() = 0;
49 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; 49 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0;
50 virtual void SendBeginMainFrameNotExpectedSoon() = 0; 50 virtual void SendBeginMainFrameNotExpectedSoon() = 0;
51 51
52 protected: 52 protected:
53 virtual ~SchedulerClient() {} 53 virtual ~SchedulerClient() {}
54 }; 54 };
55 55
56 class CC_EXPORT Scheduler : public BeginFrameObserverBase { 56 class CC_EXPORT Scheduler : public BeginFrameObserverBase {
57 public: 57 public:
58 static scoped_ptr<Scheduler> Create( 58 static std::unique_ptr<Scheduler> Create(
59 SchedulerClient* client, 59 SchedulerClient* client,
60 const SchedulerSettings& scheduler_settings, 60 const SchedulerSettings& scheduler_settings,
61 int layer_tree_host_id, 61 int layer_tree_host_id,
62 base::SingleThreadTaskRunner* task_runner, 62 base::SingleThreadTaskRunner* task_runner,
63 BeginFrameSource* begin_frame_source, 63 BeginFrameSource* begin_frame_source,
64 scoped_ptr<CompositorTimingHistory> compositor_timing_history); 64 std::unique_ptr<CompositorTimingHistory> compositor_timing_history);
65 65
66 ~Scheduler() override; 66 ~Scheduler() override;
67 67
68 // BeginFrameObserverBase 68 // BeginFrameObserverBase
69 void OnBeginFrameSourcePausedChanged(bool paused) override; 69 void OnBeginFrameSourcePausedChanged(bool paused) override;
70 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override; 70 bool OnBeginFrameDerivedImpl(const BeginFrameArgs& args) override;
71 71
72 void OnDrawForOutputSurface(bool resourceless_software_draw); 72 void OnDrawForOutputSurface(bool resourceless_software_draw);
73 73
74 const SchedulerSettings& settings() const { return settings_; } 74 const SchedulerSettings& settings() const { return settings_; }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Pass in a main_thread_start_time of base::TimeTicks() if it is not 128 // Pass in a main_thread_start_time of base::TimeTicks() if it is not
129 // known or not trustworthy (e.g. blink is running on a remote channel) 129 // known or not trustworthy (e.g. blink is running on a remote channel)
130 // to signal that the start time isn't known and should not be used for 130 // to signal that the start time isn't known and should not be used for
131 // scheduling or statistics purposes. 131 // scheduling or statistics purposes.
132 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time); 132 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time);
133 133
134 base::TimeTicks LastBeginImplFrameTime(); 134 base::TimeTicks LastBeginImplFrameTime();
135 135
136 void SetDeferCommits(bool defer_commits); 136 void SetDeferCommits(bool defer_commits);
137 137
138 scoped_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; 138 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const;
139 void AsValueInto(base::trace_event::TracedValue* value) const override; 139 void AsValueInto(base::trace_event::TracedValue* value) const override;
140 140
141 void SetChildrenNeedBeginFrames(bool children_need_begin_frames); 141 void SetChildrenNeedBeginFrames(bool children_need_begin_frames);
142 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames); 142 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames);
143 143
144 const BeginFrameSource* begin_frame_source() const { 144 const BeginFrameSource* begin_frame_source() const {
145 return begin_frame_source_; 145 return begin_frame_source_;
146 } 146 }
147 147
148 protected: 148 protected:
149 Scheduler(SchedulerClient* client, 149 Scheduler(SchedulerClient* client,
150 const SchedulerSettings& scheduler_settings, 150 const SchedulerSettings& scheduler_settings,
151 int layer_tree_host_id, 151 int layer_tree_host_id,
152 base::SingleThreadTaskRunner* task_runner, 152 base::SingleThreadTaskRunner* task_runner,
153 BeginFrameSource* begin_frame_source, 153 BeginFrameSource* begin_frame_source,
154 scoped_ptr<CompositorTimingHistory> compositor_timing_history); 154 std::unique_ptr<CompositorTimingHistory> compositor_timing_history);
155 155
156 // Virtual for testing. 156 // Virtual for testing.
157 virtual base::TimeTicks Now() const; 157 virtual base::TimeTicks Now() const;
158 158
159 const SchedulerSettings settings_; 159 const SchedulerSettings settings_;
160 // Not owned. 160 // Not owned.
161 SchedulerClient* client_; 161 SchedulerClient* client_;
162 int layer_tree_host_id_; 162 int layer_tree_host_id_;
163 base::SingleThreadTaskRunner* task_runner_; 163 base::SingleThreadTaskRunner* task_runner_;
164 164
165 // Not owned. May be null. 165 // Not owned. May be null.
166 BeginFrameSource* begin_frame_source_; 166 BeginFrameSource* begin_frame_source_;
167 bool observing_begin_frame_source_; 167 bool observing_begin_frame_source_;
168 168
169 scoped_ptr<CompositorTimingHistory> compositor_timing_history_; 169 std::unique_ptr<CompositorTimingHistory> compositor_timing_history_;
170 base::TimeDelta estimated_parent_draw_time_; 170 base::TimeDelta estimated_parent_draw_time_;
171 171
172 std::deque<BeginFrameArgs> begin_retro_frame_args_; 172 std::deque<BeginFrameArgs> begin_retro_frame_args_;
173 SchedulerStateMachine::BeginImplFrameDeadlineMode 173 SchedulerStateMachine::BeginImplFrameDeadlineMode
174 begin_impl_frame_deadline_mode_; 174 begin_impl_frame_deadline_mode_;
175 BeginFrameTracker begin_impl_frame_tracker_; 175 BeginFrameTracker begin_impl_frame_tracker_;
176 BeginFrameArgs begin_main_frame_args_; 176 BeginFrameArgs begin_main_frame_args_;
177 177
178 base::Closure begin_retro_frame_closure_; 178 base::Closure begin_retro_frame_closure_;
179 base::Closure begin_impl_frame_deadline_closure_; 179 base::Closure begin_impl_frame_deadline_closure_;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 220 }
221 221
222 base::WeakPtrFactory<Scheduler> weak_factory_; 222 base::WeakPtrFactory<Scheduler> weak_factory_;
223 223
224 DISALLOW_COPY_AND_ASSIGN(Scheduler); 224 DISALLOW_COPY_AND_ASSIGN(Scheduler);
225 }; 225 };
226 226
227 } // namespace cc 227 } // namespace cc
228 228
229 #endif // CC_SCHEDULER_SCHEDULER_H_ 229 #endif // CC_SCHEDULER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « cc/scheduler/delay_based_time_source_unittest.cc ('k') | cc/scheduler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698