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

Side by Side Diff: components/scheduler/renderer/renderer_scheduler_impl.cc

Issue 1958283005: Throttling Helper to disable task queue until PumpThrottledTasks called (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo Created 4 years, 7 months 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 | « no previous file | components/scheduler/renderer/renderer_scheduler_impl_unittest.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 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 new_policy.default_queue_policy); 837 new_policy.default_queue_policy);
838 838
839 DCHECK(compositor_task_runner_->IsQueueEnabled()); 839 DCHECK(compositor_task_runner_->IsQueueEnabled());
840 MainThreadOnly().current_policy = new_policy; 840 MainThreadOnly().current_policy = new_policy;
841 } 841 }
842 842
843 void RendererSchedulerImpl::ApplyTaskQueuePolicy( 843 void RendererSchedulerImpl::ApplyTaskQueuePolicy(
844 TaskQueue* task_queue, 844 TaskQueue* task_queue,
845 const TaskQueuePolicy& old_task_queue_policy, 845 const TaskQueuePolicy& old_task_queue_policy,
846 const TaskQueuePolicy& new_task_queue_policy) const { 846 const TaskQueuePolicy& new_task_queue_policy) const {
847 task_queue->SetQueueEnabled(new_task_queue_policy.is_enabled); 847 // The ThrottlingHelper also calls SetQueueEnabled, so we can avoid calling
848 // this here.
849 if (new_task_queue_policy.time_domain_type != TimeDomainType::THROTTLED)
850 task_queue->SetQueueEnabled(new_task_queue_policy.is_enabled);
848 if (old_task_queue_policy.priority != new_task_queue_policy.priority) 851 if (old_task_queue_policy.priority != new_task_queue_policy.priority)
849 task_queue->SetQueuePriority(new_task_queue_policy.priority); 852 task_queue->SetQueuePriority(new_task_queue_policy.priority);
850 853
851 if (old_task_queue_policy.time_domain_type != 854 if (old_task_queue_policy.time_domain_type !=
852 new_task_queue_policy.time_domain_type) { 855 new_task_queue_policy.time_domain_type) {
853 if (new_task_queue_policy.time_domain_type == TimeDomainType::THROTTLED) { 856 if (new_task_queue_policy.time_domain_type == TimeDomainType::THROTTLED) {
854 throttling_helper_->IncreaseThrottleRefCount(task_queue); 857 throttling_helper_->IncreaseThrottleRefCount(task_queue);
855 } else if (old_task_queue_policy.time_domain_type == 858 } else if (old_task_queue_policy.time_domain_type ==
856 TimeDomainType::THROTTLED) { 859 TimeDomainType::THROTTLED) {
857 throttling_helper_->DecreaseThrottleRefCount(task_queue); 860 throttling_helper_->DecreaseThrottleRefCount(task_queue);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 } 1263 }
1261 MainThreadOnly().have_reported_blocking_intervention_since_navigation = 1264 MainThreadOnly().have_reported_blocking_intervention_since_navigation =
1262 true; 1265 true;
1263 BroadcastConsoleWarning( 1266 BroadcastConsoleWarning(
1264 "Deferred long-running timer task(s) to improve scrolling smoothness. " 1267 "Deferred long-running timer task(s) to improve scrolling smoothness. "
1265 "See crbug.com/574343."); 1268 "See crbug.com/574343.");
1266 } 1269 }
1267 } 1270 }
1268 1271
1269 } // namespace scheduler 1272 } // namespace scheduler
OLDNEW
« no previous file with comments | « no previous file | components/scheduler/renderer/renderer_scheduler_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698