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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc

Issue 2885313003: [scheduler] Fix --disable-background-timer-throttling flag. (Closed)
Patch Set: Created 3 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
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 "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 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1148 new_policy.loading_queue_policy.time_domain_type = TimeDomainType::VIRTUAL; 1148 new_policy.loading_queue_policy.time_domain_type = TimeDomainType::VIRTUAL;
1149 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::VIRTUAL; 1149 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::VIRTUAL;
1150 } 1150 }
1151 1151
1152 new_policy.should_disable_throttling = 1152 new_policy.should_disable_throttling =
1153 ShouldDisableThrottlingBecauseOfAudio(now) || 1153 ShouldDisableThrottlingBecauseOfAudio(now) ||
1154 GetMainThreadOnly().use_virtual_time; 1154 GetMainThreadOnly().use_virtual_time;
1155 1155
1156 // TODO(altimin): Consider adding default timer tq to background time 1156 // TODO(altimin): Consider adding default timer tq to background time
1157 // budget pool. 1157 // budget pool.
1158 if (GetMainThreadOnly().renderer_backgrounded) 1158 if (GetMainThreadOnly().renderer_backgrounded &&
1159 RuntimeEnabledFeatures::timerThrottlingForBackgroundTabsEnabled()) {
1159 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::THROTTLED; 1160 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::THROTTLED;
1161 }
1160 1162
1161 // Tracing is done before the early out check, because it's quite possible we 1163 // Tracing is done before the early out check, because it's quite possible we
1162 // will otherwise miss this information in traces. 1164 // will otherwise miss this information in traces.
1163 CreateTraceEventObjectSnapshotLocked(); 1165 CreateTraceEventObjectSnapshotLocked();
1164 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "use_case", 1166 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "use_case",
1165 use_case); 1167 use_case);
1166 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "rail_mode", 1168 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "rail_mode",
1167 new_policy.rail_mode); 1169 new_policy.rail_mode);
1168 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 1170 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
1169 "touchstart_expected_soon", 1171 "touchstart_expected_soon",
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 case TimeDomainType::VIRTUAL: 2010 case TimeDomainType::VIRTUAL:
2009 return "virtual"; 2011 return "virtual";
2010 default: 2012 default:
2011 NOTREACHED(); 2013 NOTREACHED();
2012 return nullptr; 2014 return nullptr;
2013 } 2015 }
2014 } 2016 }
2015 2017
2016 } // namespace scheduler 2018 } // namespace scheduler
2017 } // namespace blink 2019 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698