| OLD | NEW |
| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 if (!base::FeatureList::IsEnabled(features::kPaintOptimizations)) | 246 if (!base::FeatureList::IsEnabled(features::kPaintOptimizations)) |
| 247 WebRuntimeFeatures::enableFeatureFromString("PaintOptimizations", false); | 247 WebRuntimeFeatures::enableFeatureFromString("PaintOptimizations", false); |
| 248 | 248 |
| 249 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) | 249 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) |
| 250 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); | 250 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); |
| 251 | 251 |
| 252 WebRuntimeFeatures::enableRenderingPipelineThrottling( | 252 WebRuntimeFeatures::enableRenderingPipelineThrottling( |
| 253 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); | 253 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); |
| 254 | 254 |
| 255 if (command_line.HasSwitch(switches::kDisableBackgroundTimerThrottling)) |
| 256 WebRuntimeFeatures::enableTimerThrottlingForBackgroundTabs(false); |
| 257 |
| 255 #if defined(OS_ANDROID) | 258 #if defined(OS_ANDROID) |
| 256 WebRuntimeFeatures::enablePaymentRequest( | 259 WebRuntimeFeatures::enablePaymentRequest( |
| 257 base::FeatureList::IsEnabled(features::kWebPayments)); | 260 base::FeatureList::IsEnabled(features::kWebPayments)); |
| 258 #endif | 261 #endif |
| 259 | 262 |
| 260 // Enable explicitly enabled features, and then disable explicitly disabled | 263 // Enable explicitly enabled features, and then disable explicitly disabled |
| 261 // ones. | 264 // ones. |
| 262 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 265 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 263 std::vector<std::string> enabled_features = base::SplitString( | 266 std::vector<std::string> enabled_features = base::SplitString( |
| 264 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 267 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 265 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 268 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 266 for (const std::string& feature : enabled_features) | 269 for (const std::string& feature : enabled_features) |
| 267 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 270 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 268 } | 271 } |
| 269 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 272 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 270 std::vector<std::string> disabled_features = base::SplitString( | 273 std::vector<std::string> disabled_features = base::SplitString( |
| 271 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 274 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 272 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 275 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 273 for (const std::string& feature : disabled_features) | 276 for (const std::string& feature : disabled_features) |
| 274 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 277 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 275 } | 278 } |
| 276 } | 279 } |
| 277 | 280 |
| 278 } // namespace content | 281 } // namespace content |
| OLD | NEW |