| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 void RendererSchedulerImpl::RemoveWebViewScheduler( | 1297 void RendererSchedulerImpl::RemoveWebViewScheduler( |
| 1298 WebViewSchedulerImpl* web_view_scheduler) { | 1298 WebViewSchedulerImpl* web_view_scheduler) { |
| 1299 DCHECK(MainThreadOnly().web_view_schedulers_.find(web_view_scheduler) != | 1299 DCHECK(MainThreadOnly().web_view_schedulers_.find(web_view_scheduler) != |
| 1300 MainThreadOnly().web_view_schedulers_.end()); | 1300 MainThreadOnly().web_view_schedulers_.end()); |
| 1301 MainThreadOnly().web_view_schedulers_.erase(web_view_scheduler); | 1301 MainThreadOnly().web_view_schedulers_.erase(web_view_scheduler); |
| 1302 } | 1302 } |
| 1303 | 1303 |
| 1304 void RendererSchedulerImpl::BroadcastConsoleWarning( | 1304 void RendererSchedulerImpl::BroadcastConsoleWarning( |
| 1305 const std::string& message) { | 1305 const std::string& message) { |
| 1306 helper_.CheckOnValidThread(); | 1306 helper_.CheckOnValidThread(); |
| 1307 for (auto& web_view_scheduler : MainThreadOnly().web_view_schedulers_) | 1307 for (auto* web_view_scheduler : MainThreadOnly().web_view_schedulers_) |
| 1308 web_view_scheduler->AddConsoleWarning(message); | 1308 web_view_scheduler->AddConsoleWarning(message); |
| 1309 } | 1309 } |
| 1310 | 1310 |
| 1311 void RendererSchedulerImpl::OnTriedToExecuteBlockedTask( | 1311 void RendererSchedulerImpl::OnTriedToExecuteBlockedTask( |
| 1312 const TaskQueue& queue, | 1312 const TaskQueue& queue, |
| 1313 const base::PendingTask& task) { | 1313 const base::PendingTask& task) { |
| 1314 if (!MainThreadOnly().expensive_task_blocking_allowed || | 1314 if (!MainThreadOnly().expensive_task_blocking_allowed || |
| 1315 MainThreadOnly().current_use_case == UseCase::TOUCHSTART || | 1315 MainThreadOnly().current_use_case == UseCase::TOUCHSTART || |
| 1316 MainThreadOnly().longest_jank_free_task_duration < | 1316 MainThreadOnly().longest_jank_free_task_duration < |
| 1317 base::TimeDelta::FromMilliseconds(kRailsResponseTimeMillis) || | 1317 base::TimeDelta::FromMilliseconds(kRailsResponseTimeMillis) || |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1342 BroadcastConsoleWarning( | 1342 BroadcastConsoleWarning( |
| 1343 "Blink deferred a task in order to make scrolling smoother. " | 1343 "Blink deferred a task in order to make scrolling smoother. " |
| 1344 "Your timer and network tasks should take less than 50ms to run " | 1344 "Your timer and network tasks should take less than 50ms to run " |
| 1345 "to avoid this. Please see " | 1345 "to avoid this. Please see " |
| 1346 "https://developers.google.com/web/tools/chrome-devtools/profile/evaluat
e-performance/rail" | 1346 "https://developers.google.com/web/tools/chrome-devtools/profile/evaluat
e-performance/rail" |
| 1347 " and https://crbug.com/574343#c40 for more information."); | 1347 " and https://crbug.com/574343#c40 for more information."); |
| 1348 } | 1348 } |
| 1349 } | 1349 } |
| 1350 | 1350 |
| 1351 } // namespace scheduler | 1351 } // namespace scheduler |
| OLD | NEW |