Chromium Code Reviews| 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 "platform/scheduler/renderer/renderer_scheduler_impl.h" | 5 #include "platform/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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 // Amount of idle time left in a frame (as a ratio of the vsync interval) above | 38 // Amount of idle time left in a frame (as a ratio of the vsync interval) above |
| 39 // which main thread compositing can be considered fast. | 39 // which main thread compositing can be considered fast. |
| 40 const double kFastCompositingIdleTimeThreshold = .2; | 40 const double kFastCompositingIdleTimeThreshold = .2; |
| 41 constexpr base::TimeDelta kThreadLoadTrackerReportingInterval = | 41 constexpr base::TimeDelta kThreadLoadTrackerReportingInterval = |
| 42 base::TimeDelta::FromMinutes(1); | 42 base::TimeDelta::FromMinutes(1); |
| 43 constexpr base::TimeDelta kThreadLoadTrackerWaitingPeriodBeforeReporting = | 43 constexpr base::TimeDelta kThreadLoadTrackerWaitingPeriodBeforeReporting = |
| 44 base::TimeDelta::FromMinutes(2); | 44 base::TimeDelta::FromMinutes(2); |
| 45 // We do not throttle anything while audio is played and shortly after that. | 45 // We do not throttle anything while audio is played and shortly after that. |
| 46 constexpr base::TimeDelta kThrottlingDelayAfterAudioIsPlayed = | 46 constexpr base::TimeDelta kThrottlingDelayAfterAudioIsPlayed = |
| 47 base::TimeDelta::FromSeconds(5); | 47 base::TimeDelta::FromSeconds(5); |
| 48 // Maximum task queueing time before the main thread is considered unresponsive. | |
| 49 constexpr base::TimeDelta kMainThreadResponsivenessThreshold = | |
| 50 base::TimeDelta::FromMilliseconds(200); | |
| 48 | 51 |
| 49 void ReportForegroundRendererTaskLoad(base::TimeTicks time, double load) { | 52 void ReportForegroundRendererTaskLoad(base::TimeTicks time, double load) { |
| 50 int load_percentage = static_cast<int>(load * 100); | 53 int load_percentage = static_cast<int>(load * 100); |
| 51 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.ForegroundRendererMainThreadLoad", | 54 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.ForegroundRendererMainThreadLoad", |
| 52 load_percentage); | 55 load_percentage); |
| 53 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 56 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 54 "RendererScheduler.ForegroundRendererLoad", load_percentage); | 57 "RendererScheduler.ForegroundRendererLoad", load_percentage); |
| 55 } | 58 } |
| 56 | 59 |
| 57 void ReportBackgroundRendererTaskLoad(base::TimeTicks time, double load) { | 60 void ReportBackgroundRendererTaskLoad(base::TimeTicks time, double load) { |
| 58 int load_percentage = static_cast<int>(load * 100); | 61 int load_percentage = static_cast<int>(load * 100); |
| 59 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.BackgroundRendererMainThreadLoad", | 62 UMA_HISTOGRAM_PERCENTAGE("RendererScheduler.BackgroundRendererMainThreadLoad", |
| 60 load_percentage); | 63 load_percentage); |
| 61 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 64 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 62 "RendererScheduler.BackgroundRendererLoad", load_percentage); | 65 "RendererScheduler.BackgroundRendererLoad", load_percentage); |
| 63 } | 66 } |
| 64 | 67 |
| 65 base::TimeTicks MonotonicTimeInSecondsToTimeTicks( | 68 base::TimeTicks MonotonicTimeInSecondsToTimeTicks( |
| 66 double monotonicTimeInSeconds) { | 69 double monotonicTimeInSeconds) { |
| 67 return base::TimeTicks() + base::TimeDelta::FromSecondsD( | 70 return base::TimeTicks() + |
| 68 monotonicTimeInSeconds); | 71 base::TimeDelta::FromSecondsD(monotonicTimeInSeconds); |
| 69 } | 72 } |
| 70 } // namespace | 73 } // namespace |
| 71 | 74 |
| 72 RendererSchedulerImpl::RendererSchedulerImpl( | 75 RendererSchedulerImpl::RendererSchedulerImpl( |
| 73 scoped_refptr<SchedulerTqmDelegate> main_task_runner) | 76 scoped_refptr<SchedulerTqmDelegate> main_task_runner) |
| 74 : helper_(main_task_runner, | 77 : helper_(main_task_runner, |
| 75 "renderer.scheduler", | 78 "renderer.scheduler", |
| 76 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 79 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 77 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug")), | 80 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug")), |
| 78 idle_helper_(&helper_, | 81 idle_helper_(&helper_, |
| 79 this, | 82 this, |
| 80 "renderer.scheduler", | 83 "renderer.scheduler", |
| 81 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), | 84 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), |
| 82 "RendererSchedulerIdlePeriod", | 85 "RendererSchedulerIdlePeriod", |
| 83 base::TimeDelta()), | 86 base::TimeDelta()), |
| 84 render_widget_scheduler_signals_(this), | 87 render_widget_scheduler_signals_(this), |
| 85 control_task_runner_(helper_.ControlTaskRunner()), | 88 control_task_runner_(helper_.ControlTaskRunner()), |
| 86 compositor_task_runner_( | 89 compositor_task_runner_( |
| 87 helper_.NewTaskQueue(TaskQueue::Spec(TaskQueue::QueueType::COMPOSITOR) | 90 helper_.NewTaskQueue(TaskQueue::Spec(TaskQueue::QueueType::COMPOSITOR) |
| 88 .SetShouldMonitorQuiescence(true))), | 91 .SetShouldMonitorQuiescence(true))), |
| 89 delayed_update_policy_runner_( | 92 delayed_update_policy_runner_( |
| 90 base::Bind(&RendererSchedulerImpl::UpdatePolicy, | 93 base::Bind(&RendererSchedulerImpl::UpdatePolicy, |
| 91 base::Unretained(this)), | 94 base::Unretained(this)), |
| 92 helper_.ControlTaskRunner()), | 95 helper_.ControlTaskRunner()), |
| 96 seqlock_queueing_time_estimator_( | |
| 97 QueueingTimeEstimator(this, base::TimeDelta::FromSeconds(1))), | |
| 93 main_thread_only_(this, | 98 main_thread_only_(this, |
| 94 compositor_task_runner_, | 99 compositor_task_runner_, |
| 95 helper_.scheduler_tqm_delegate().get(), | 100 helper_.scheduler_tqm_delegate().get(), |
| 96 helper_.scheduler_tqm_delegate()->NowTicks()), | 101 helper_.scheduler_tqm_delegate()->NowTicks()), |
| 102 any_thread_(this), | |
| 97 policy_may_need_update_(&any_thread_lock_), | 103 policy_may_need_update_(&any_thread_lock_), |
| 104 main_thread_responsiveness_threshold_(kMainThreadResponsivenessThreshold), | |
| 98 weak_factory_(this) { | 105 weak_factory_(this) { |
| 99 task_queue_throttler_.reset( | 106 task_queue_throttler_.reset( |
| 100 new TaskQueueThrottler(this, "renderer.scheduler")); | 107 new TaskQueueThrottler(this, "renderer.scheduler")); |
| 101 update_policy_closure_ = base::Bind(&RendererSchedulerImpl::UpdatePolicy, | 108 update_policy_closure_ = base::Bind(&RendererSchedulerImpl::UpdatePolicy, |
| 102 weak_factory_.GetWeakPtr()); | 109 weak_factory_.GetWeakPtr()); |
| 103 end_renderer_hidden_idle_period_closure_.Reset(base::Bind( | 110 end_renderer_hidden_idle_period_closure_.Reset(base::Bind( |
| 104 &RendererSchedulerImpl::EndIdlePeriod, weak_factory_.GetWeakPtr())); | 111 &RendererSchedulerImpl::EndIdlePeriod, weak_factory_.GetWeakPtr())); |
| 105 | 112 |
| 106 suspend_timers_when_backgrounded_closure_.Reset( | 113 suspend_timers_when_backgrounded_closure_.Reset( |
| 107 base::Bind(&RendererSchedulerImpl::SuspendTimerQueueWhenBackgrounded, | 114 base::Bind(&RendererSchedulerImpl::SuspendTimerQueueWhenBackgrounded, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 RendererSchedulerImpl* renderer_scheduler_impl, | 156 RendererSchedulerImpl* renderer_scheduler_impl, |
| 150 const scoped_refptr<TaskQueue>& compositor_task_runner, | 157 const scoped_refptr<TaskQueue>& compositor_task_runner, |
| 151 base::TickClock* time_source, | 158 base::TickClock* time_source, |
| 152 base::TimeTicks now) | 159 base::TimeTicks now) |
| 153 : loading_task_cost_estimator(time_source, | 160 : loading_task_cost_estimator(time_source, |
| 154 kLoadingTaskEstimationSampleCount, | 161 kLoadingTaskEstimationSampleCount, |
| 155 kLoadingTaskEstimationPercentile), | 162 kLoadingTaskEstimationPercentile), |
| 156 timer_task_cost_estimator(time_source, | 163 timer_task_cost_estimator(time_source, |
| 157 kTimerTaskEstimationSampleCount, | 164 kTimerTaskEstimationSampleCount, |
| 158 kTimerTaskEstimationPercentile), | 165 kTimerTaskEstimationPercentile), |
| 159 queueing_time_estimator(renderer_scheduler_impl, | |
| 160 base::TimeDelta::FromSeconds(1)), | |
| 161 idle_time_estimator(compositor_task_runner, | 166 idle_time_estimator(compositor_task_runner, |
| 162 time_source, | 167 time_source, |
| 163 kShortIdlePeriodDurationSampleCount, | 168 kShortIdlePeriodDurationSampleCount, |
| 164 kShortIdlePeriodDurationPercentile), | 169 kShortIdlePeriodDurationPercentile), |
| 165 background_main_thread_load_tracker( | 170 background_main_thread_load_tracker( |
| 166 now, | 171 now, |
| 167 base::Bind(&ReportBackgroundRendererTaskLoad), | 172 base::Bind(&ReportBackgroundRendererTaskLoad), |
| 168 kThreadLoadTrackerReportingInterval, | 173 kThreadLoadTrackerReportingInterval, |
| 169 kThreadLoadTrackerWaitingPeriodBeforeReporting), | 174 kThreadLoadTrackerWaitingPeriodBeforeReporting), |
| 170 foreground_main_thread_load_tracker( | 175 foreground_main_thread_load_tracker( |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 190 have_reported_blocking_intervention_since_navigation(false), | 195 have_reported_blocking_intervention_since_navigation(false), |
| 191 has_visible_render_widget_with_touch_handler(false), | 196 has_visible_render_widget_with_touch_handler(false), |
| 192 begin_frame_not_expected_soon(false), | 197 begin_frame_not_expected_soon(false), |
| 193 in_idle_period_for_testing(false), | 198 in_idle_period_for_testing(false), |
| 194 use_virtual_time(false), | 199 use_virtual_time(false), |
| 195 is_audio_playing(false), | 200 is_audio_playing(false), |
| 196 rail_mode_observer(nullptr) {} | 201 rail_mode_observer(nullptr) {} |
| 197 | 202 |
| 198 RendererSchedulerImpl::MainThreadOnly::~MainThreadOnly() {} | 203 RendererSchedulerImpl::MainThreadOnly::~MainThreadOnly() {} |
| 199 | 204 |
| 200 RendererSchedulerImpl::AnyThread::AnyThread() | 205 RendererSchedulerImpl::AnyThread::AnyThread( |
| 206 RendererSchedulerImpl* renderer_scheduler_impl) | |
| 201 : awaiting_touch_start_response(false), | 207 : awaiting_touch_start_response(false), |
| 202 in_idle_period(false), | 208 in_idle_period(false), |
| 203 begin_main_frame_on_critical_path(false), | 209 begin_main_frame_on_critical_path(false), |
| 204 last_gesture_was_compositor_driven(false), | 210 last_gesture_was_compositor_driven(false), |
| 205 default_gesture_prevented(true), | 211 default_gesture_prevented(true), |
| 206 have_seen_touchstart(false) {} | 212 have_seen_touchstart(false) {} |
| 207 | 213 |
| 208 RendererSchedulerImpl::AnyThread::~AnyThread() {} | 214 RendererSchedulerImpl::AnyThread::~AnyThread() {} |
| 209 | 215 |
| 210 RendererSchedulerImpl::CompositorThreadOnly::CompositorThreadOnly() | 216 RendererSchedulerImpl::CompositorThreadOnly::CompositorThreadOnly() |
| 211 : last_input_type(blink::WebInputEvent::Undefined) {} | 217 : last_input_type(blink::WebInputEvent::Undefined), |
| 218 main_thread_seems_unresponsive(false) {} | |
| 212 | 219 |
| 213 RendererSchedulerImpl::CompositorThreadOnly::~CompositorThreadOnly() {} | 220 RendererSchedulerImpl::CompositorThreadOnly::~CompositorThreadOnly() {} |
| 214 | 221 |
| 215 void RendererSchedulerImpl::Shutdown() { | 222 void RendererSchedulerImpl::Shutdown() { |
| 216 base::TimeTicks now = tick_clock()->NowTicks(); | 223 base::TimeTicks now = tick_clock()->NowTicks(); |
| 217 MainThreadOnly().background_main_thread_load_tracker.RecordIdle(now); | 224 MainThreadOnly().background_main_thread_load_tracker.RecordIdle(now); |
| 218 MainThreadOnly().foreground_main_thread_load_tracker.RecordIdle(now); | 225 MainThreadOnly().foreground_main_thread_load_tracker.RecordIdle(now); |
| 219 | 226 |
| 220 task_queue_throttler_.reset(); | 227 task_queue_throttler_.reset(); |
| 221 helper_.Shutdown(); | 228 helper_.Shutdown(); |
| (...skipping 1281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 default_loading_task_runner_->SetBlameContext(blame_context); | 1510 default_loading_task_runner_->SetBlameContext(blame_context); |
| 1504 default_timer_task_runner_->SetBlameContext(blame_context); | 1511 default_timer_task_runner_->SetBlameContext(blame_context); |
| 1505 compositor_task_runner_->SetBlameContext(blame_context); | 1512 compositor_task_runner_->SetBlameContext(blame_context); |
| 1506 idle_helper_.IdleTaskRunner()->SetBlameContext(blame_context); | 1513 idle_helper_.IdleTaskRunner()->SetBlameContext(blame_context); |
| 1507 } | 1514 } |
| 1508 | 1515 |
| 1509 void RendererSchedulerImpl::SetRAILModeObserver(RAILModeObserver* observer) { | 1516 void RendererSchedulerImpl::SetRAILModeObserver(RAILModeObserver* observer) { |
| 1510 MainThreadOnly().rail_mode_observer = observer; | 1517 MainThreadOnly().rail_mode_observer = observer; |
| 1511 } | 1518 } |
| 1512 | 1519 |
| 1520 bool RendererSchedulerImpl::MainThreadSeemsUnresponsive() { | |
| 1521 base::TimeTicks now = tick_clock()->NowTicks(); | |
|
alex clarke (OOO till 29th)
2016/11/14 17:00:17
Is it worth adding a TRACE_EVENT here?
tdresser
2016/12/15 13:17:00
For when we're checking if the main thread is unre
| |
| 1522 base::TimeDelta estimated_queueing_time; | |
| 1523 | |
| 1524 bool can_read = false; | |
| 1525 QueueingTimeEstimator::Data queueing_time_estimator_data; | |
| 1526 | |
| 1527 base::subtle::Atomic32 version; | |
| 1528 seqlock_queueing_time_estimator_.seqlock.ReadOrFail(&can_read, &version); | |
| 1529 | |
| 1530 // If we fail to determine if the main thread is busy, assume whether or not | |
| 1531 // it's busy hasn't change since the last time we asked. | |
| 1532 if (!can_read) | |
| 1533 return CompositorThreadOnly().main_thread_seems_unresponsive; | |
| 1534 | |
| 1535 queueing_time_estimator_data = seqlock_queueing_time_estimator_.data.data(); | |
| 1536 | |
| 1537 // If we fail to determine if the main thread is busy, assume whether or not | |
| 1538 // it's busy hasn't change since the last time we asked. | |
| 1539 if (seqlock_queueing_time_estimator_.seqlock.ReadRetry(version)) | |
| 1540 return CompositorThreadOnly().main_thread_seems_unresponsive; | |
| 1541 | |
| 1542 QueueingTimeEstimator queueing_time_estimator(queueing_time_estimator_data); | |
| 1543 | |
| 1544 estimated_queueing_time = | |
| 1545 queueing_time_estimator.EstimateQueueingTimeIncludingCurrentTask(now); | |
| 1546 | |
| 1547 bool main_thread_seems_unresponsive = | |
| 1548 estimated_queueing_time > main_thread_responsiveness_threshold_; | |
| 1549 { | |
|
Sami
2016/11/14 21:16:45
nit: any reason for these braces? We're not grabbi
tdresser
2016/12/15 13:17:00
Done.
| |
| 1550 CompositorThreadOnly().main_thread_seems_unresponsive = | |
| 1551 main_thread_seems_unresponsive; | |
| 1552 } | |
| 1553 | |
| 1554 return main_thread_seems_unresponsive; | |
| 1555 } | |
| 1556 | |
| 1513 void RendererSchedulerImpl::RegisterTimeDomain(TimeDomain* time_domain) { | 1557 void RendererSchedulerImpl::RegisterTimeDomain(TimeDomain* time_domain) { |
| 1514 helper_.RegisterTimeDomain(time_domain); | 1558 helper_.RegisterTimeDomain(time_domain); |
| 1515 } | 1559 } |
| 1516 | 1560 |
| 1517 void RendererSchedulerImpl::UnregisterTimeDomain(TimeDomain* time_domain) { | 1561 void RendererSchedulerImpl::UnregisterTimeDomain(TimeDomain* time_domain) { |
| 1518 helper_.UnregisterTimeDomain(time_domain); | 1562 helper_.UnregisterTimeDomain(time_domain); |
| 1519 } | 1563 } |
| 1520 | 1564 |
| 1521 base::TickClock* RendererSchedulerImpl::tick_clock() const { | 1565 base::TickClock* RendererSchedulerImpl::tick_clock() const { |
| 1522 return helper_.scheduler_tqm_delegate().get(); | 1566 return helper_.scheduler_tqm_delegate().get(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1567 base::AutoLock lock(any_thread_lock_); | 1611 base::AutoLock lock(any_thread_lock_); |
| 1568 if (!AnyThread().have_seen_touchstart) | 1612 if (!AnyThread().have_seen_touchstart) |
| 1569 return; | 1613 return; |
| 1570 } | 1614 } |
| 1571 MainThreadOnly().have_reported_blocking_intervention_since_navigation = | 1615 MainThreadOnly().have_reported_blocking_intervention_since_navigation = |
| 1572 true; | 1616 true; |
| 1573 BroadcastIntervention( | 1617 BroadcastIntervention( |
| 1574 "Blink deferred a task in order to make scrolling smoother. " | 1618 "Blink deferred a task in order to make scrolling smoother. " |
| 1575 "Your timer and network tasks should take less than 50ms to run " | 1619 "Your timer and network tasks should take less than 50ms to run " |
| 1576 "to avoid this. Please see " | 1620 "to avoid this. Please see " |
| 1577 "https://developers.google.com/web/tools/chrome-devtools/profile/evaluat e-performance/rail" | 1621 "https://developers.google.com/web/tools/chrome-devtools/profile/" |
| 1622 "evaluate-performance/rail" | |
| 1578 " and https://crbug.com/574343#c40 for more information."); | 1623 " and https://crbug.com/574343#c40 for more information."); |
| 1579 } | 1624 } |
| 1580 } | 1625 } |
| 1581 | 1626 |
| 1582 void RendererSchedulerImpl::ReportTaskTime(TaskQueue* task_queue, | 1627 void RendererSchedulerImpl::ReportTaskStartTime(double start_time) { |
| 1583 double start_time, | 1628 base::TimeTicks start_time_ticks = |
| 1584 double end_time) { | 1629 MonotonicTimeInSecondsToTimeTicks(start_time); |
| 1630 MainThreadOnly().current_task_start_time = start_time_ticks; | |
| 1631 seqlock_queueing_time_estimator_.seqlock.WriteBegin(); | |
| 1632 seqlock_queueing_time_estimator_.data.OnTopLevelTaskStarted(start_time_ticks); | |
| 1633 seqlock_queueing_time_estimator_.seqlock.WriteEnd(); | |
| 1634 } | |
| 1635 | |
| 1636 void RendererSchedulerImpl::ReportTaskEndTime(TaskQueue* task_queue, | |
| 1637 double start_time, | |
| 1638 double end_time) { | |
| 1585 // TODO(scheduler-dev): Remove conversions when Blink starts using | 1639 // TODO(scheduler-dev): Remove conversions when Blink starts using |
| 1586 // base::TimeTicks instead of doubles for time. | 1640 // base::TimeTicks instead of doubles for time. |
| 1587 base::TimeTicks start_time_ticks = | 1641 base::TimeTicks start_time_ticks = |
| 1588 MonotonicTimeInSecondsToTimeTicks(start_time); | 1642 MonotonicTimeInSecondsToTimeTicks(start_time); |
| 1589 base::TimeTicks end_time_ticks = MonotonicTimeInSecondsToTimeTicks(end_time); | 1643 base::TimeTicks end_time_ticks = MonotonicTimeInSecondsToTimeTicks(end_time); |
| 1590 | 1644 |
| 1591 MainThreadOnly().queueing_time_estimator.OnToplevelTaskCompleted( | 1645 seqlock_queueing_time_estimator_.seqlock.WriteBegin(); |
| 1592 start_time_ticks, end_time_ticks); | 1646 seqlock_queueing_time_estimator_.data.OnTopLevelTaskCompleted(end_time_ticks); |
| 1647 seqlock_queueing_time_estimator_.seqlock.WriteEnd(); | |
| 1593 | 1648 |
| 1594 task_queue_throttler()->OnTaskRunTimeReported(task_queue, start_time_ticks, | 1649 task_queue_throttler()->OnTaskRunTimeReported(task_queue, start_time_ticks, |
| 1595 end_time_ticks); | 1650 end_time_ticks); |
| 1596 | 1651 |
| 1597 // We want to measure thread time here, but for efficiency reasons | 1652 // We want to measure thread time here, but for efficiency reasons |
| 1598 // we stick with wall time. | 1653 // we stick with wall time. |
| 1599 MainThreadOnly().foreground_main_thread_load_tracker.RecordTaskTime( | 1654 MainThreadOnly().foreground_main_thread_load_tracker.RecordTaskTime( |
| 1600 start_time_ticks, end_time_ticks); | 1655 start_time_ticks, end_time_ticks); |
| 1601 MainThreadOnly().background_main_thread_load_tracker.RecordTaskTime( | 1656 MainThreadOnly().background_main_thread_load_tracker.RecordTaskTime( |
| 1602 start_time_ticks, end_time_ticks); | 1657 start_time_ticks, end_time_ticks); |
| 1603 // TODO(altimin): Per-page metrics should also be considered. | 1658 // TODO(altimin): Per-page metrics should also be considered. |
| 1604 UMA_HISTOGRAM_CUSTOM_COUNTS("RendererScheduler.TaskTime", | 1659 UMA_HISTOGRAM_CUSTOM_COUNTS( |
| 1605 (end_time_ticks - start_time_ticks).InMicroseconds (), 1, | 1660 "RendererScheduler.TaskTime", |
| 1606 1000000, 50); | 1661 (end_time_ticks - start_time_ticks).InMicroseconds(), 1, 1000000, 50); |
| 1607 UMA_HISTOGRAM_ENUMERATION("RendererScheduler.NumberOfTasksPerQueueType", | 1662 UMA_HISTOGRAM_ENUMERATION("RendererScheduler.NumberOfTasksPerQueueType", |
| 1608 static_cast<int>(task_queue->GetQueueType()), | 1663 static_cast<int>(task_queue->GetQueueType()), |
| 1609 static_cast<int>(TaskQueue::QueueType::COUNT)); | 1664 static_cast<int>(TaskQueue::QueueType::COUNT)); |
| 1610 } | 1665 } |
| 1611 | 1666 |
| 1612 void RendererSchedulerImpl::AddTaskTimeObserver( | 1667 void RendererSchedulerImpl::AddTaskTimeObserver( |
| 1613 TaskTimeObserver* task_time_observer) { | 1668 TaskTimeObserver* task_time_observer) { |
| 1614 helper_.AddTaskTimeObserver(task_time_observer); | 1669 helper_.AddTaskTimeObserver(task_time_observer); |
| 1615 } | 1670 } |
| 1616 | 1671 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1704 case v8::PERFORMANCE_LOAD: | 1759 case v8::PERFORMANCE_LOAD: |
| 1705 return "load"; | 1760 return "load"; |
| 1706 default: | 1761 default: |
| 1707 NOTREACHED(); | 1762 NOTREACHED(); |
| 1708 return nullptr; | 1763 return nullptr; |
| 1709 } | 1764 } |
| 1710 } | 1765 } |
| 1711 | 1766 |
| 1712 } // namespace scheduler | 1767 } // namespace scheduler |
| 1713 } // namespace blink | 1768 } // namespace blink |
| OLD | NEW |