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