| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } | 364 } |
| 365 | 365 |
| 366 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) | 366 if (base::FeatureList::IsEnabled(features::kLoadingWithMojo)) |
| 367 WebRuntimeFeatures::enableLoadingWithMojo(true); | 367 WebRuntimeFeatures::enableLoadingWithMojo(true); |
| 368 | 368 |
| 369 if (!base::FeatureList::IsEnabled(features::kBlockCredentialedSubresources)) { | 369 if (!base::FeatureList::IsEnabled(features::kBlockCredentialedSubresources)) { |
| 370 WebRuntimeFeatures::enableFeatureFromString("BlockCredentialedSubresources", | 370 WebRuntimeFeatures::enableFeatureFromString("BlockCredentialedSubresources", |
| 371 false); | 371 false); |
| 372 } | 372 } |
| 373 | 373 |
| 374 WebRuntimeFeatures::enableFeatureFromString( |
| 375 "AllowContentInitiatedDataUrlNavigations", |
| 376 base::FeatureList::IsEnabled( |
| 377 features::kAllowContentInitiatedDataUrlNavigations)); |
| 378 |
| 374 // Enable explicitly enabled features, and then disable explicitly disabled | 379 // Enable explicitly enabled features, and then disable explicitly disabled |
| 375 // ones. | 380 // ones. |
| 376 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 381 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 377 std::vector<std::string> enabled_features = base::SplitString( | 382 std::vector<std::string> enabled_features = base::SplitString( |
| 378 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 383 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 379 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 384 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 380 for (const std::string& feature : enabled_features) | 385 for (const std::string& feature : enabled_features) |
| 381 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 386 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 382 } | 387 } |
| 383 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 388 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 384 std::vector<std::string> disabled_features = base::SplitString( | 389 std::vector<std::string> disabled_features = base::SplitString( |
| 385 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 390 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 386 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 391 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 387 for (const std::string& feature : disabled_features) | 392 for (const std::string& feature : disabled_features) |
| 388 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 393 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 389 } | 394 } |
| 390 } | 395 } |
| 391 | 396 |
| 392 } // namespace content | 397 } // namespace content |
| OLD | NEW |