| 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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 void RendererSchedulerImpl::RemoveWebViewScheduler( | 1337 void RendererSchedulerImpl::RemoveWebViewScheduler( |
| 1338 WebViewSchedulerImpl* web_view_scheduler) { | 1338 WebViewSchedulerImpl* web_view_scheduler) { |
| 1339 DCHECK(MainThreadOnly().web_view_schedulers.find(web_view_scheduler) != | 1339 DCHECK(MainThreadOnly().web_view_schedulers.find(web_view_scheduler) != |
| 1340 MainThreadOnly().web_view_schedulers.end()); | 1340 MainThreadOnly().web_view_schedulers.end()); |
| 1341 MainThreadOnly().web_view_schedulers.erase(web_view_scheduler); | 1341 MainThreadOnly().web_view_schedulers.erase(web_view_scheduler); |
| 1342 } | 1342 } |
| 1343 | 1343 |
| 1344 void RendererSchedulerImpl::BroadcastConsoleWarning( | 1344 void RendererSchedulerImpl::BroadcastConsoleWarning( |
| 1345 const std::string& message) { | 1345 const std::string& message) { |
| 1346 helper_.CheckOnValidThread(); | 1346 helper_.CheckOnValidThread(); |
| 1347 for (auto& web_view_scheduler : MainThreadOnly().web_view_schedulers) | 1347 for (auto* web_view_scheduler : MainThreadOnly().web_view_schedulers) |
| 1348 web_view_scheduler->AddConsoleWarning(message); | 1348 web_view_scheduler->AddConsoleWarning(message); |
| 1349 } | 1349 } |
| 1350 | 1350 |
| 1351 void RendererSchedulerImpl::OnTriedToExecuteBlockedTask( | 1351 void RendererSchedulerImpl::OnTriedToExecuteBlockedTask( |
| 1352 const TaskQueue& queue, | 1352 const TaskQueue& queue, |
| 1353 const base::PendingTask& task) { | 1353 const base::PendingTask& task) { |
| 1354 if (!MainThreadOnly().expensive_task_blocking_allowed || | 1354 if (!MainThreadOnly().expensive_task_blocking_allowed || |
| 1355 MainThreadOnly().current_use_case == UseCase::TOUCHSTART || | 1355 MainThreadOnly().current_use_case == UseCase::TOUCHSTART || |
| 1356 MainThreadOnly().longest_jank_free_task_duration < | 1356 MainThreadOnly().longest_jank_free_task_duration < |
| 1357 base::TimeDelta::FromMilliseconds(kRailsResponseTimeMillis) || | 1357 base::TimeDelta::FromMilliseconds(kRailsResponseTimeMillis) || |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 return "idle"; | 1443 return "idle"; |
| 1444 case v8::PERFORMANCE_LOAD: | 1444 case v8::PERFORMANCE_LOAD: |
| 1445 return "load"; | 1445 return "load"; |
| 1446 default: | 1446 default: |
| 1447 NOTREACHED(); | 1447 NOTREACHED(); |
| 1448 return nullptr; | 1448 return nullptr; |
| 1449 } | 1449 } |
| 1450 } | 1450 } |
| 1451 | 1451 |
| 1452 } // namespace scheduler | 1452 } // namespace scheduler |
| OLD | NEW |