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