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

Side by Side Diff: content/child/runtime_features.cc

Issue 2345483002: [scheduler] Throttle background frames with 1% CPU limit (Closed)
Patch Set: [scheduler] Throttle background frames with 1% CPU limit Created 4 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/child/runtime_features.h" 5 #include "content/child/runtime_features.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 "FramebustingNeedsSameOriginOrUserGesture", 272 "FramebustingNeedsSameOriginOrUserGesture",
273 base::FeatureList::IsEnabled( 273 base::FeatureList::IsEnabled(
274 features::kFramebustingNeedsSameOriginOrUserGesture)); 274 features::kFramebustingNeedsSameOriginOrUserGesture));
275 275
276 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) 276 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread))
277 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); 277 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true);
278 278
279 if (command_line.HasSwitch(switches::kDisableBackgroundTimerThrottling)) 279 if (command_line.HasSwitch(switches::kDisableBackgroundTimerThrottling))
280 WebRuntimeFeatures::enableTimerThrottlingForBackgroundTabs(false); 280 WebRuntimeFeatures::enableTimerThrottlingForBackgroundTabs(false);
281 281
282 WebRuntimeFeatures::enableExpensiveBackgroundTimerThrottling(
283 base::FeatureList::IsEnabled(
284 features::kExpensiveBackgroundTimerThrottling));
285
282 WebRuntimeFeatures::enableRenderingPipelineThrottling( 286 WebRuntimeFeatures::enableRenderingPipelineThrottling(
283 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); 287 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling));
284 288
285 WebRuntimeFeatures::enableTimerThrottlingForHiddenFrames( 289 WebRuntimeFeatures::enableTimerThrottlingForHiddenFrames(
286 base::FeatureList::IsEnabled(features::kTimerThrottlingForHiddenFrames)); 290 base::FeatureList::IsEnabled(features::kTimerThrottlingForHiddenFrames));
287 291
288 if (base::FeatureList::IsEnabled( 292 if (base::FeatureList::IsEnabled(
289 features::kSendBeaconThrowForBlobWithNonSimpleType)) 293 features::kSendBeaconThrowForBlobWithNonSimpleType))
290 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); 294 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true);
291 295
(...skipping 20 matching lines...) Expand all
312 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 316 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
313 std::vector<std::string> disabled_features = base::SplitString( 317 std::vector<std::string> disabled_features = base::SplitString(
314 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 318 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
315 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 319 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
316 for (const std::string& feature : disabled_features) 320 for (const std::string& feature : disabled_features)
317 WebRuntimeFeatures::enableFeatureFromString(feature, false); 321 WebRuntimeFeatures::enableFeatureFromString(feature, false);
318 } 322 }
319 } 323 }
320 324
321 } // namespace content 325 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698