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

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

Powered by Google App Engine
This is Rietveld 408576698