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

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: fix test crash 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 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 new_policy.loading_queue_policy.time_domain_type = TimeDomainType::VIRTUAL; 1165 new_policy.loading_queue_policy.time_domain_type = TimeDomainType::VIRTUAL;
1166 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::VIRTUAL; 1166 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::VIRTUAL;
1167 } 1167 }
1168 1168
1169 new_policy.should_disable_throttling = 1169 new_policy.should_disable_throttling =
1170 ShouldDisableThrottlingBecauseOfAudio(now) || 1170 ShouldDisableThrottlingBecauseOfAudio(now) ||
1171 GetMainThreadOnly().use_virtual_time; 1171 GetMainThreadOnly().use_virtual_time;
1172 1172
1173 // TODO(altimin): Consider adding default timer tq to background time 1173 // TODO(altimin): Consider adding default timer tq to background time
1174 // budget pool. 1174 // budget pool.
1175 if (GetMainThreadOnly().renderer_backgrounded) 1175 if (GetMainThreadOnly().renderer_backgrounded &&
1176 RuntimeEnabledFeatures::timerThrottlingForBackgroundTabsEnabled()) {
1176 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::THROTTLED; 1177 new_policy.timer_queue_policy.time_domain_type = TimeDomainType::THROTTLED;
1178 }
1177 1179
1178 // Tracing is done before the early out check, because it's quite possible we 1180 // Tracing is done before the early out check, because it's quite possible we
1179 // will otherwise miss this information in traces. 1181 // will otherwise miss this information in traces.
1180 CreateTraceEventObjectSnapshotLocked(); 1182 CreateTraceEventObjectSnapshotLocked();
1181 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "use_case", 1183 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "use_case",
1182 use_case); 1184 use_case);
1183 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "rail_mode", 1185 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), "rail_mode",
1184 new_policy.rail_mode); 1186 new_policy.rail_mode);
1185 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"), 1187 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("renderer.scheduler"),
1186 "touchstart_expected_soon", 1188 "touchstart_expected_soon",
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2054 case TimeDomainType::VIRTUAL: 2056 case TimeDomainType::VIRTUAL:
2055 return "virtual"; 2057 return "virtual";
2056 default: 2058 default:
2057 NOTREACHED(); 2059 NOTREACHED();
2058 return nullptr; 2060 return nullptr;
2059 } 2061 }
2060 } 2062 }
2061 2063
2062 } // namespace scheduler 2064 } // namespace scheduler
2063 } // namespace blink 2065 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698