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