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

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

Issue 898483004: Add --{enable,disable}-blink-features flags which set RuntimeEnabledFeatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address jochen review comments Created 5 years, 10 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>
8
7 #include "base/command_line.h" 9 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/strings/string_split.h"
9 #include "content/common/content_switches_internal.h" 12 #include "content/common/content_switches_internal.h"
10 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
11 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" 14 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
12 #include "ui/native_theme/native_theme_switches.h" 15 #include "ui/native_theme/native_theme_switches.h"
13 16
14 #if defined(OS_ANDROID) 17 #if defined(OS_ANDROID)
15 #include <cpu-features.h> 18 #include <cpu-features.h>
16 #include "base/android/build_info.h" 19 #include "base/android/build_info.h"
17 #include "base/metrics/field_trial.h" 20 #include "base/metrics/field_trial.h"
18 #include "media/base/android/media_codec_bridge.h" 21 #include "media/base/android/media_codec_bridge.h"
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 if (command_line.HasSwitch(switches::kReducedReferrerGranularity)) 182 if (command_line.HasSwitch(switches::kReducedReferrerGranularity))
180 WebRuntimeFeatures::enableReducedReferrerGranularity(true); 183 WebRuntimeFeatures::enableReducedReferrerGranularity(true);
181 184
182 if (command_line.HasSwitch(switches::kEnablePushMessagePayload)) 185 if (command_line.HasSwitch(switches::kEnablePushMessagePayload))
183 WebRuntimeFeatures::enablePushMessagingData(true); 186 WebRuntimeFeatures::enablePushMessagingData(true);
184 187
185 if (command_line.HasSwitch(switches::kDisableV8IdleTasks)) 188 if (command_line.HasSwitch(switches::kDisableV8IdleTasks))
186 WebRuntimeFeatures::enableV8IdleTasks(false); 189 WebRuntimeFeatures::enableV8IdleTasks(false);
187 else 190 else
188 WebRuntimeFeatures::enableV8IdleTasks(true); 191 WebRuntimeFeatures::enableV8IdleTasks(true);
192
193 // Enable explicitly enabled features, and then disable explicitly disabled
194 // ones.
195 if (command_line.HasSwitch(switches::kEnableBlinkFeatures)) {
196 std::vector<std::string> enabled_features;
197 base::SplitString(
198 command_line.GetSwitchValueASCII(switches::kEnableBlinkFeatures), ',',
199 &enabled_features);
200 for (const std::string& feature : enabled_features) {
201 WebRuntimeFeatures::enableFeatureFromString(
202 blink::WebString::fromLatin1(feature), true);
203 }
204 }
205 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) {
206 std::vector<std::string> disabled_features;
207 base::SplitString(
208 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',',
209 &disabled_features);
210 for (const std::string& feature : disabled_features) {
211 WebRuntimeFeatures::enableFeatureFromString(
212 blink::WebString::fromLatin1(feature), false);
213 }
214 }
189 } 215 }
190 216
191 } // namespace content 217 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698