| 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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) | 299 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) |
| 300 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); | 300 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); |
| 301 | 301 |
| 302 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) | 302 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) |
| 303 WebRuntimeFeatures::enableGamepadExtensions(true); | 303 WebRuntimeFeatures::enableGamepadExtensions(true); |
| 304 | 304 |
| 305 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) | 305 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) |
| 306 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", | 306 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", |
| 307 false); | 307 false); |
| 308 | 308 |
| 309 if (base::FeatureList::IsEnabled(features::kGenericSensor)) |
| 310 WebRuntimeFeatures::enableGenericSensor(true); |
| 311 |
| 309 // Enable explicitly enabled features, and then disable explicitly disabled | 312 // Enable explicitly enabled features, and then disable explicitly disabled |
| 310 // ones. | 313 // ones. |
| 311 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 314 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 312 std::vector<std::string> enabled_features = base::SplitString( | 315 std::vector<std::string> enabled_features = base::SplitString( |
| 313 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 316 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 314 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 317 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 315 for (const std::string& feature : enabled_features) | 318 for (const std::string& feature : enabled_features) |
| 316 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 319 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 317 } | 320 } |
| 318 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 321 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 319 std::vector<std::string> disabled_features = base::SplitString( | 322 std::vector<std::string> disabled_features = base::SplitString( |
| 320 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 323 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 321 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 324 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 322 for (const std::string& feature : disabled_features) | 325 for (const std::string& feature : disabled_features) |
| 323 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 326 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 324 } | 327 } |
| 325 } | 328 } |
| 326 | 329 |
| 327 } // namespace content | 330 } // namespace content |
| OLD | NEW |