OLD | NEW |
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 #include "components/scheduler/renderer/renderer_scheduler_impl.h" | 5 #include "components/scheduler/renderer/renderer_scheduler_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/stack_trace.h" | 8 #include "base/debug/stack_trace.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1146 AnyThread().user_model.Reset(helper_.scheduler_tqm_delegate()->NowTicks()); | 1146 AnyThread().user_model.Reset(helper_.scheduler_tqm_delegate()->NowTicks()); |
1147 AnyThread().have_seen_touchstart = false; | 1147 AnyThread().have_seen_touchstart = false; |
1148 MainThreadOnly().loading_task_cost_estimator.Clear(); | 1148 MainThreadOnly().loading_task_cost_estimator.Clear(); |
1149 MainThreadOnly().timer_task_cost_estimator.Clear(); | 1149 MainThreadOnly().timer_task_cost_estimator.Clear(); |
1150 MainThreadOnly().idle_time_estimator.Clear(); | 1150 MainThreadOnly().idle_time_estimator.Clear(); |
1151 MainThreadOnly().have_seen_a_begin_main_frame = false; | 1151 MainThreadOnly().have_seen_a_begin_main_frame = false; |
1152 MainThreadOnly().have_reported_blocking_intervention_since_navigation = false; | 1152 MainThreadOnly().have_reported_blocking_intervention_since_navigation = false; |
1153 UpdatePolicyLocked(UpdateType::MAY_EARLY_OUT_IF_POLICY_UNCHANGED); | 1153 UpdatePolicyLocked(UpdateType::MAY_EARLY_OUT_IF_POLICY_UNCHANGED); |
1154 } | 1154 } |
1155 | 1155 |
| 1156 void RendererSchedulerImpl::SetTopLevelBlameContext( |
| 1157 base::trace_event::BlameContext* blame_context) { |
| 1158 // Any task that runs in the default task runners belongs to the context of |
| 1159 // all frames (as opposed to a particular frame). Note that the task itself |
| 1160 // may still enter a more specific blame context if necessary. |
| 1161 // |
| 1162 // Per-frame task runners (loading, timers, etc.) are configured with a more |
| 1163 // specific blame context by WebFrameSchedulerImpl. |
| 1164 control_task_runner_->SetBlameContext(blame_context); |
| 1165 DefaultTaskRunner()->SetBlameContext(blame_context); |
| 1166 default_loading_task_runner_->SetBlameContext(blame_context); |
| 1167 default_timer_task_runner_->SetBlameContext(blame_context); |
| 1168 compositor_task_runner_->SetBlameContext(blame_context); |
| 1169 idle_helper_.IdleTaskRunner()->SetBlameContext(blame_context); |
| 1170 } |
| 1171 |
1156 void RendererSchedulerImpl::RegisterTimeDomain(TimeDomain* time_domain) { | 1172 void RendererSchedulerImpl::RegisterTimeDomain(TimeDomain* time_domain) { |
1157 helper_.RegisterTimeDomain(time_domain); | 1173 helper_.RegisterTimeDomain(time_domain); |
1158 } | 1174 } |
1159 | 1175 |
1160 void RendererSchedulerImpl::UnregisterTimeDomain(TimeDomain* time_domain) { | 1176 void RendererSchedulerImpl::UnregisterTimeDomain(TimeDomain* time_domain) { |
1161 helper_.UnregisterTimeDomain(time_domain); | 1177 helper_.UnregisterTimeDomain(time_domain); |
1162 } | 1178 } |
1163 | 1179 |
1164 void RendererSchedulerImpl::SetExpensiveTaskBlockingAllowed(bool allowed) { | 1180 void RendererSchedulerImpl::SetExpensiveTaskBlockingAllowed(bool allowed) { |
1165 MainThreadOnly().expensive_task_blocking_allowed = allowed; | 1181 MainThreadOnly().expensive_task_blocking_allowed = allowed; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 } | 1223 } |
1208 MainThreadOnly().have_reported_blocking_intervention_since_navigation = | 1224 MainThreadOnly().have_reported_blocking_intervention_since_navigation = |
1209 true; | 1225 true; |
1210 BroadcastConsoleWarning( | 1226 BroadcastConsoleWarning( |
1211 "Deferred long-running timer task(s) to improve scrolling smoothness. " | 1227 "Deferred long-running timer task(s) to improve scrolling smoothness. " |
1212 "See crbug.com/574343."); | 1228 "See crbug.com/574343."); |
1213 } | 1229 } |
1214 } | 1230 } |
1215 | 1231 |
1216 } // namespace scheduler | 1232 } // namespace scheduler |
OLD | NEW |