| 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/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 WebRuntimeFeatures::enablePushMessagingHasPermission(true); | 194 WebRuntimeFeatures::enablePushMessagingHasPermission(true); |
| 195 | 195 |
| 196 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) | 196 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) |
| 197 WebRuntimeFeatures::enableV8IdleTasks(false); | 197 WebRuntimeFeatures::enableV8IdleTasks(false); |
| 198 else | 198 else |
| 199 WebRuntimeFeatures::enableV8IdleTasks(true); | 199 WebRuntimeFeatures::enableV8IdleTasks(true); |
| 200 | 200 |
| 201 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) | 201 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) |
| 202 WebRuntimeFeatures::enableUnsafeES3APIs(true); | 202 WebRuntimeFeatures::enableUnsafeES3APIs(true); |
| 203 | 203 |
| 204 if (command_line.HasSwitch(switches::kEnableWebVR)) { |
| 205 WebRuntimeFeatures::enableVRDevice(true); |
| 206 WebRuntimeFeatures::enableFeatureFromString("GeometryInterfaces", true); |
| 207 } |
| 208 |
| 204 // Enable explicitly enabled features, and then disable explicitly disabled | 209 // Enable explicitly enabled features, and then disable explicitly disabled |
| 205 // ones. | 210 // ones. |
| 206 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { | 211 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { |
| 207 std::vector<std::string> enabled_features; | 212 std::vector<std::string> enabled_features; |
| 208 base::SplitString( | 213 base::SplitString( |
| 209 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',', | 214 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',', |
| 210 &enabled_features); | 215 &enabled_features); |
| 211 for (const std::string& feature : enabled_features) { | 216 for (const std::string& feature : enabled_features) { |
| 212 WebRuntimeFeatures::enableFeatureFromString( | 217 WebRuntimeFeatures::enableFeatureFromString( |
| 213 blink::WebString::fromLatin1(feature), true); | 218 blink::WebString::fromLatin1(feature), true); |
| 214 } | 219 } |
| 215 } | 220 } |
| 216 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 221 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 217 std::vector<std::string> disabled_features; | 222 std::vector<std::string> disabled_features; |
| 218 base::SplitString( | 223 base::SplitString( |
| 219 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', | 224 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', |
| 220 &disabled_features); | 225 &disabled_features); |
| 221 for (const std::string& feature : disabled_features) { | 226 for (const std::string& feature : disabled_features) { |
| 222 WebRuntimeFeatures::enableFeatureFromString( | 227 WebRuntimeFeatures::enableFeatureFromString( |
| 223 blink::WebString::fromLatin1(feature), false); | 228 blink::WebString::fromLatin1(feature), false); |
| 224 } | 229 } |
| 225 } | 230 } |
| 226 } | 231 } |
| 227 | 232 |
| 228 } // namespace content | 233 } // namespace content |
| OLD | NEW |