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