| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 if (!base::FeatureList::IsEnabled(features::kPaintOptimizations)) | 239 if (!base::FeatureList::IsEnabled(features::kPaintOptimizations)) |
| 240 WebRuntimeFeatures::enableFeatureFromString("PaintOptimizations", false); | 240 WebRuntimeFeatures::enableFeatureFromString("PaintOptimizations", false); |
| 241 | 241 |
| 242 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) | 242 if (base::FeatureList::IsEnabled(features::kParseHTMLOnMainThread)) |
| 243 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); | 243 WebRuntimeFeatures::enableFeatureFromString("ParseHTMLOnMainThread", true); |
| 244 | 244 |
| 245 WebRuntimeFeatures::enableRenderingPipelineThrottling( | 245 WebRuntimeFeatures::enableRenderingPipelineThrottling( |
| 246 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); | 246 base::FeatureList::IsEnabled(features::kRenderingPipelineThrottling)); |
| 247 | 247 |
| 248 #if defined(OS_ANDROID) |
| 249 WebRuntimeFeatures::enablePaymentRequest( |
| 250 base::FeatureList::IsEnabled(features::kWebPayments)); |
| 251 #endif |
| 252 |
| 248 // Enable explicitly enabled features, and then disable explicitly disabled | 253 // Enable explicitly enabled features, and then disable explicitly disabled |
| 249 // ones. | 254 // ones. |
| 250 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 255 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 251 std::vector<std::string> enabled_features = base::SplitString( | 256 std::vector<std::string> enabled_features = base::SplitString( |
| 252 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), | 257 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), |
| 253 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 258 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 254 for (const std::string& feature : enabled_features) | 259 for (const std::string& feature : enabled_features) |
| 255 WebRuntimeFeatures::enableFeatureFromString(feature, true); | 260 WebRuntimeFeatures::enableFeatureFromString(feature, true); |
| 256 } | 261 } |
| 257 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 262 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 258 std::vector<std::string> disabled_features = base::SplitString( | 263 std::vector<std::string> disabled_features = base::SplitString( |
| 259 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 264 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 260 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 265 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 261 for (const std::string& feature : disabled_features) | 266 for (const std::string& feature : disabled_features) |
| 262 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 267 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 263 } | 268 } |
| 264 } | 269 } |
| 265 | 270 |
| 266 } // namespace content | 271 } // namespace content |
| OLD | NEW |