| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueFixedPosition", | 350 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueFixedPosition", |
| 351 true); | 351 true); |
| 352 | 352 |
| 353 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) | 353 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) |
| 354 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", | 354 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", |
| 355 false); | 355 false); |
| 356 | 356 |
| 357 if (base::FeatureList::IsEnabled(features::kGenericSensor)) | 357 if (base::FeatureList::IsEnabled(features::kGenericSensor)) |
| 358 WebRuntimeFeatures::enableGenericSensor(true); | 358 WebRuntimeFeatures::enableGenericSensor(true); |
| 359 | 359 |
| 360 if (base::FeatureList::IsEnabled(features::kFasterLocationReload)) | |
| 361 WebRuntimeFeatures::enableFasterLocationReload(true); | |
| 362 | |
| 363 // Enable features which VrShell depends on. | 360 // Enable features which VrShell depends on. |
| 364 if (base::FeatureList::IsEnabled(features::kVrShell)) { | 361 if (base::FeatureList::IsEnabled(features::kVrShell)) { |
| 365 WebRuntimeFeatures::enableGamepadExtensions(true); | 362 WebRuntimeFeatures::enableGamepadExtensions(true); |
| 366 WebRuntimeFeatures::enableWebVR(true); | 363 WebRuntimeFeatures::enableWebVR(true); |
| 367 } | 364 } |
| 368 | 365 |
| 369 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) | 366 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) |
| 370 WebRuntimeFeatures::enableLoadingWithMojo(true); | 367 WebRuntimeFeatures::enableLoadingWithMojo(true); |
| 371 | 368 |
| 372 // Enable explicitly enabled features, and then disable explicitly disabled | 369 // Enable explicitly enabled features, and then disable explicitly disabled |
| 373 // ones. | 370 // ones. |
| 374 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 371 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 375 std::vector<std::string> enabled_features = base::SplitString( | 372 std::vector<std::string> enabled_features = base::SplitString( |
| 376 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 373 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 377 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 374 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 378 for (const std::string& feature : enabled_features) | 375 for (const std::string& feature : enabled_features) |
| 379 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 376 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 380 } | 377 } |
| 381 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 378 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 382 std::vector<std::string> disabled_features = base::SplitString( | 379 std::vector<std::string> disabled_features = base::SplitString( |
| 383 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 380 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 384 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 381 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 385 for (const std::string& feature : disabled_features) | 382 for (const std::string& feature : disabled_features) |
| 386 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 383 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 387 } | 384 } |
| 388 } | 385 } |
| 389 | 386 |
| 390 } // namespace content | 387 } // namespace content |
| OLD | NEW |