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

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

Issue 1269793007: Explicitly pass WebString to enableFeatureFromString() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) 195 if (command_line.HasSwitch(switches::kDisableV8IdleTasks))
196 WebRuntimeFeatures::enableV8IdleTasks(false); 196 WebRuntimeFeatures::enableV8IdleTasks(false);
197 else 197 else
198 WebRuntimeFeatures::enableV8IdleTasks(true); 198 WebRuntimeFeatures::enableV8IdleTasks(true);
199 199
200 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs)) 200 if (command_line.HasSwitch(switches::kEnableUnsafeES3APIs))
201 WebRuntimeFeatures::enableUnsafeES3APIs(true); 201 WebRuntimeFeatures::enableUnsafeES3APIs(true);
202 202
203 if (command_line.HasSwitch(switches::kEnableWebVR)) { 203 if (command_line.HasSwitch(switches::kEnableWebVR)) {
204 WebRuntimeFeatures::enableWebVR(true); 204 WebRuntimeFeatures::enableWebVR(true);
205 WebRuntimeFeatures::enableFeatureFromString("GeometryInterfaces", true); 205 // TODO(bashi): Remove blink::WebString() cast.
206 WebRuntimeFeatures::enableFeatureFromString(
207 blink::WebString("GeometryInterfaces"), true);
206 } 208 }
207 209
208 // Enable explicitly enabled features, and then disable explicitly disabled 210 // Enable explicitly enabled features, and then disable explicitly disabled
209 // ones. 211 // ones.
210 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) { 212 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
211 std::vector<std::string> enabled_features; 213 std::vector<std::string> enabled_features;
212 base::SplitString( 214 base::SplitString(
213 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',', 215 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',',
214 &enabled_features); 216 &enabled_features);
215 for (const std::string& feature : enabled_features) { 217 for (const std::string& feature : enabled_features) {
216 WebRuntimeFeatures::enableFeatureFromString( 218 WebRuntimeFeatures::enableFeatureFromString(
217 blink::WebString::fromLatin1(feature), true); 219 blink::WebString::fromLatin1(feature), true);
218 } 220 }
219 } 221 }
220 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { 222 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
221 std::vector<std::string> disabled_features; 223 std::vector<std::string> disabled_features;
222 base::SplitString( 224 base::SplitString(
223 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', 225 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',',
224 &disabled_features); 226 &disabled_features);
225 for (const std::string& feature : disabled_features) { 227 for (const std::string& feature : disabled_features) {
226 WebRuntimeFeatures::enableFeatureFromString( 228 WebRuntimeFeatures::enableFeatureFromString(
227 blink::WebString::fromLatin1(feature), false); 229 blink::WebString::fromLatin1(feature), false);
228 } 230 }
229 } 231 }
230 } 232 }
231 233
232 } // namespace content 234 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698