Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: content/child/runtime_features.cc

Issue 829803003: Adding Chrome-side WebVR interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates/cleanups before pulling in reviewers. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 WebRuntimeFeatures::enablePushMessagingHasPermission(true); 197 WebRuntimeFeatures::enablePushMessagingHasPermission(true);
198 198
199 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) 199 if (command_line.HasSwitch(switches::kDisableV8IdleTasks))
200 WebRuntimeFeatures::enableV8IdleTasks(false); 200 WebRuntimeFeatures::enableV8IdleTasks(false);
201 else 201 else
202 WebRuntimeFeatures::enableV8IdleTasks(true); 202 WebRuntimeFeatures::enableV8IdleTasks(true);
203 203
204 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) 204 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs))
205 WebRuntimeFeatures::enableUnsafeES3APIs(true); 205 WebRuntimeFeatures::enableUnsafeES3APIs(true);
206 206
207 if (command_line.HasSwitch(switches::kEnableVR)) {
208 WebRuntimeFeatures::enableVRDevice(true);
209 WebRuntimeFeatures::enableFeatureFromString("GeometryInterfaces", true);
210 }
211
207 // Enable explicitly enabled features, and then disable explicitly disabled 212 // Enable explicitly enabled features, and then disable explicitly disabled
208 // ones. 213 // ones.
209 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 214 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
210 std::vector<std::string> enabled_features; 215 std::vector<std::string> enabled_features;
211 base::SplitString( 216 base::SplitString(
212 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',', 217 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',',
213 &enabled_features); 218 &enabled_features);
214 for (const std::string& feature : enabled_features) { 219 for (const std::string& feature : enabled_features) {
215 WebRuntimeFeatures::enableFeatureFromString( 220 WebRuntimeFeatures::enableFeatureFromString(
216 blink::WebString::fromLatin1(feature), true); 221 blink::WebString::fromLatin1(feature), true);
217 } 222 }
218 } 223 }
219 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 224 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
220 std::vector<std::string> disabled_features; 225 std::vector<std::string> disabled_features;
221 base::SplitString( 226 base::SplitString(
222 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', 227 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',',
223 &disabled_features); 228 &disabled_features);
224 for (const std::string& feature : disabled_features) { 229 for (const std::string& feature : disabled_features) {
225 WebRuntimeFeatures::enableFeatureFromString( 230 WebRuntimeFeatures::enableFeatureFromString(
226 blink::WebString::fromLatin1(feature), false); 231 blink::WebString::fromLatin1(feature), false);
227 } 232 }
228 } 233 }
229 } 234 }
230 235
231 } // namespace content 236 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698