| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 | 254 |
| 255 if (base::FeatureList::IsEnabled( | 255 if (base::FeatureList::IsEnabled( |
| 256 features::kSendBeaconThrowForBlobWithNonSimpleType)) | 256 features::kSendBeaconThrowForBlobWithNonSimpleType)) |
| 257 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); | 257 WebRuntimeFeatures::enableSendBeaconThrowForBlobWithNonSimpleType(true); |
| 258 | 258 |
| 259 #if defined(OS_ANDROID) | 259 #if defined(OS_ANDROID) |
| 260 WebRuntimeFeatures::enablePaymentRequest( | 260 WebRuntimeFeatures::enablePaymentRequest( |
| 261 base::FeatureList::IsEnabled(features::kWebPayments)); | 261 base::FeatureList::IsEnabled(features::kWebPayments)); |
| 262 #endif | 262 #endif |
| 263 | 263 |
| 264 if (base::FeatureList::IsEnabled(features::kSpeculativeLaunchServiceWorker)) |
| 265 WebRuntimeFeatures::enableSpeculativeLaunchServiceWorker(true); |
| 266 |
| 264 // Enable explicitly enabled features, and then disable explicitly disabled | 267 // Enable explicitly enabled features, and then disable explicitly disabled |
| 265 // ones. | 268 // ones. |
| 266 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 269 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 267 std::vector<std::string> enabled_features = base::SplitString( | 270 std::vector<std::string> enabled_features = base::SplitString( |
| 268 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 271 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 269 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 272 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 270 for (const std::string& feature : enabled_features) | 273 for (const std::string& feature : enabled_features) |
| 271 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 274 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 272 } | 275 } |
| 273 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 276 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 274 std::vector<std::string> disabled_features = base::SplitString( | 277 std::vector<std::string> disabled_features = base::SplitString( |
| 275 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 278 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 276 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 279 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 277 for (const std::string& feature : disabled_features) | 280 for (const std::string& feature : disabled_features) |
| 278 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 281 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 279 } | 282 } |
| 280 } | 283 } |
| 281 | 284 |
| 282 } // namespace content | 285 } // namespace content |
| OLD | NEW |