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

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

Issue 2345483002: [scheduler] Throttle background frames with 1% CPU limit (Closed)
Patch Set: Rebased 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/public/common/content_features.h » ('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 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 "FramebustingNeedsSameOriginOrUserGesture", 277 "FramebustingNeedsSameOriginOrUserGesture",
278 base::FeatureList::IsEnabled( 278 base::FeatureList::IsEnabled(
279 features::kFramebustingNeedsSameOriginOrUserGesture)); 279 features::kFramebustingNeedsSameOriginOrUserGesture));
280 280
281 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) 281 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread))
282 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); 282 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true);
283 283
284 if (command_line.HasSwitch(switches::kDisableBackgroundTimerThrottling)) 284 if (command_line.HasSwitch(switches::kDisableBackgroundTimerThrottling))
285 WebRuntimeFeatures::enableTimerThrottlingForBackgroundTabs(false); 285 WebRuntimeFeatures::enableTimerThrottlingForBackgroundTabs(false);
286 286
287 WebRuntimeFeatures::enableExpensiveBackgroundTimerThrottling(
288 base::FeatureList::IsEnabled(
289 features::kExpensiveBackgroundTimerThrottling));
290
287 WebRuntimeFeatures::enableRenderingPipelineThrottling( 291 WebRuntimeFeatures::enableRenderingPipelineThrottling(
288 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); 292 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling));
289 293
290 WebRuntimeFeatures::enableTimerThrottlingForHiddenFrames( 294 WebRuntimeFeatures::enableTimerThrottlingForHiddenFrames(
291 base::FeatureList::IsEnabled(features::kTimerThrottlingForHiddenFrames)); 295 base::FeatureList::IsEnabled(features::kTimerThrottlingForHiddenFrames));
292 296
293 if (base::FeatureList::IsEnabled( 297 if (base::FeatureList::IsEnabled(
294 features::kSendBeaconThrowForBlobWithNonSimpleType)) 298 features::kSendBeaconThrowForBlobWithNonSimpleType))
295 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); 299 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true);
296 300
(...skipping 27 matching lines...) Expand all
324 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 328 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
325 std::vector<std::string> disabled_features = base::SplitString( 329 std::vector<std::string> disabled_features = base::SplitString(
326 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), 330 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures),
327 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); 331 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
328 for (const std::string& feature : disabled_features) 332 for (const std::string& feature : disabled_features)
329 WebRuntimeFeatures::enableFeatureFromString(feature, false); 333 WebRuntimeFeatures::enableFeatureFromString(feature, false);
330 } 334 }
331 } 335 }
332 336
333 } // namespace content 337 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | content/public/common/content_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698