| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // be available only when a valid origin trial token is set. This check is | 333 // be available only when a valid origin trial token is set. This check is |
| 334 // done by the generated code of | 334 // done by the generated code of |
| 335 // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled(). See the | 335 // blink::OriginTrials::serviceWorkerNavigationPreloadEnabled(). See the |
| 336 // comments in service_worker_version.h for the details. | 336 // comments in service_worker_version.h for the details. |
| 337 if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine( | 337 if (base::FeatureList::GetInstance()->IsFeatureOverriddenFromCommandLine( |
| 338 features::kServiceWorkerNavigationPreload.name, | 338 features::kServiceWorkerNavigationPreload.name, |
| 339 base::FeatureList::OVERRIDE_ENABLE_FEATURE)) { | 339 base::FeatureList::OVERRIDE_ENABLE_FEATURE)) { |
| 340 WebRuntimeFeatures::enableServiceWorkerNavigationPreload(true); | 340 WebRuntimeFeatures::enableServiceWorkerNavigationPreload(true); |
| 341 } | 341 } |
| 342 | 342 |
| 343 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) | |
| 344 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); | |
| 345 | |
| 346 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) | 343 if (base::FeatureList::IsEnabled(features::kGamepadExtensions)) |
| 347 WebRuntimeFeatures::enableGamepadExtensions(true); | 344 WebRuntimeFeatures::enableGamepadExtensions(true); |
| 348 | 345 |
| 349 if (base::FeatureList::IsEnabled(features::kCompositeOpaqueFixedPosition)) | 346 if (base::FeatureList::IsEnabled(features::kCompositeOpaqueFixedPosition)) |
| 350 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueFixedPosition", | 347 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueFixedPosition", |
| 351 true); | 348 true); |
| 352 | 349 |
| 353 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) | 350 if (!base::FeatureList::IsEnabled(features::kCompositeOpaqueScrollers)) |
| 354 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", | 351 WebRuntimeFeatures::enableFeatureFromString("CompositeOpaqueScrollers", |
| 355 false); | 352 false); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 383 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 380 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 384 std::vector<std::string> disabled_features = base::SplitString( | 381 std::vector<std::string> disabled_features = base::SplitString( |
| 385 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 382 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 386 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 383 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 387 for (const std::string& feature : disabled_features) | 384 for (const std::string& feature : disabled_features) |
| 388 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 385 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 389 } | 386 } |
| 390 } | 387 } |
| 391 | 388 |
| 392 } // namespace content | 389 } // namespace content |
| OLD | NEW |