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

Side by Side Diff: cc/test/scheduler_test_common.cc

Issue 1425973003: cc: Don't attempt main thread synchronization if it is slow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase; change names; use enum class Created 5 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
« no previous file with comments | « cc/test/scheduler_test_common.h ('k') | cc/trees/thread_proxy.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "cc/test/scheduler_test_common.h" 5 #include "cc/test/scheduler_test_common.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/debug/rendering_stats_instrumentation.h" 10 #include "cc/debug/rendering_stats_instrumentation.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 : CompositorTimingHistory(CompositorTimingHistory::NULL_UMA, 77 : CompositorTimingHistory(CompositorTimingHistory::NULL_UMA,
78 rendering_stats_instrumentation.get()), 78 rendering_stats_instrumentation.get()),
79 rendering_stats_instrumentation_owned_( 79 rendering_stats_instrumentation_owned_(
80 std::move(rendering_stats_instrumentation)) {} 80 std::move(rendering_stats_instrumentation)) {}
81 81
82 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { 82 FakeCompositorTimingHistory::~FakeCompositorTimingHistory() {
83 } 83 }
84 84
85 void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) { 85 void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) {
86 begin_main_frame_to_commit_duration_ = duration; 86 begin_main_frame_to_commit_duration_ = duration;
87 begin_main_frame_queue_duration_critical_ = duration;
88 begin_main_frame_queue_duration_not_critical_ = duration;
89 begin_main_frame_start_to_commit_duration_ = duration;
87 commit_to_ready_to_activate_duration_ = duration; 90 commit_to_ready_to_activate_duration_ = duration;
88 prepare_tiles_duration_ = duration; 91 prepare_tiles_duration_ = duration;
89 activate_duration_ = duration; 92 activate_duration_ = duration;
90 draw_duration_ = duration; 93 draw_duration_ = duration;
91 } 94 }
92 95
93 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate( 96 void FakeCompositorTimingHistory::SetBeginMainFrameToCommitDurationEstimate(
94 base::TimeDelta duration) { 97 base::TimeDelta duration) {
95 begin_main_frame_to_commit_duration_ = duration; 98 begin_main_frame_to_commit_duration_ = duration;
96 } 99 }
97 100
101 void FakeCompositorTimingHistory::
102 SetBeginMainFrameQueueDurationCriticalEstimate(base::TimeDelta duration) {
103 begin_main_frame_queue_duration_critical_ = duration;
104 }
105
106 void FakeCompositorTimingHistory::
107 SetBeginMainFrameQueueDurationNotCriticalEstimate(
108 base::TimeDelta duration) {
109 begin_main_frame_queue_duration_not_critical_ = duration;
110 }
111
112 void FakeCompositorTimingHistory::
113 SetBeginMainFrameStartToCommitDurationEstimate(base::TimeDelta duration) {
114 begin_main_frame_start_to_commit_duration_ = duration;
115 }
116
98 void FakeCompositorTimingHistory::SetCommitToReadyToActivateDurationEstimate( 117 void FakeCompositorTimingHistory::SetCommitToReadyToActivateDurationEstimate(
99 base::TimeDelta duration) { 118 base::TimeDelta duration) {
100 commit_to_ready_to_activate_duration_ = duration; 119 commit_to_ready_to_activate_duration_ = duration;
101 } 120 }
102 121
103 void FakeCompositorTimingHistory::SetPrepareTilesDurationEstimate( 122 void FakeCompositorTimingHistory::SetPrepareTilesDurationEstimate(
104 base::TimeDelta duration) { 123 base::TimeDelta duration) {
105 prepare_tiles_duration_ = duration; 124 prepare_tiles_duration_ = duration;
106 } 125 }
107 126
108 void FakeCompositorTimingHistory::SetActivateDurationEstimate( 127 void FakeCompositorTimingHistory::SetActivateDurationEstimate(
109 base::TimeDelta duration) { 128 base::TimeDelta duration) {
110 activate_duration_ = duration; 129 activate_duration_ = duration;
111 } 130 }
112 131
113 void FakeCompositorTimingHistory::SetDrawDurationEstimate( 132 void FakeCompositorTimingHistory::SetDrawDurationEstimate(
114 base::TimeDelta duration) { 133 base::TimeDelta duration) {
115 draw_duration_ = duration; 134 draw_duration_ = duration;
116 } 135 }
117 136
118 base::TimeDelta 137 base::TimeDelta
119 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const { 138 FakeCompositorTimingHistory::BeginMainFrameToCommitDurationEstimate() const {
120 return begin_main_frame_to_commit_duration_; 139 return begin_main_frame_to_commit_duration_;
121 } 140 }
122 141
123 base::TimeDelta 142 base::TimeDelta
143 FakeCompositorTimingHistory::BeginMainFrameQueueDurationCriticalEstimate()
144 const {
145 return begin_main_frame_queue_duration_critical_;
146 }
147
148 base::TimeDelta
149 FakeCompositorTimingHistory::BeginMainFrameQueueDurationNotCriticalEstimate()
150 const {
151 return begin_main_frame_queue_duration_not_critical_;
152 }
153
154 base::TimeDelta
155 FakeCompositorTimingHistory::BeginMainFrameStartToCommitDurationEstimate()
156 const {
157 return begin_main_frame_start_to_commit_duration_;
158 }
159
160 base::TimeDelta
124 FakeCompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const { 161 FakeCompositorTimingHistory::CommitToReadyToActivateDurationEstimate() const {
125 return commit_to_ready_to_activate_duration_; 162 return commit_to_ready_to_activate_duration_;
126 } 163 }
127 164
128 base::TimeDelta FakeCompositorTimingHistory::PrepareTilesDurationEstimate() 165 base::TimeDelta FakeCompositorTimingHistory::PrepareTilesDurationEstimate()
129 const { 166 const {
130 return prepare_tiles_duration_; 167 return prepare_tiles_duration_;
131 } 168 }
132 169
133 base::TimeDelta FakeCompositorTimingHistory::ActivateDurationEstimate() const { 170 base::TimeDelta FakeCompositorTimingHistory::ActivateDurationEstimate() const {
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 now_src_(now_src) {} 218 now_src_(now_src) {}
182 219
183 base::TimeTicks TestScheduler::Now() const { 220 base::TimeTicks TestScheduler::Now() const {
184 return now_src_->NowTicks(); 221 return now_src_->NowTicks();
185 } 222 }
186 223
187 TestScheduler::~TestScheduler() { 224 TestScheduler::~TestScheduler() {
188 } 225 }
189 226
190 } // namespace cc 227 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/scheduler_test_common.h ('k') | cc/trees/thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698