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> |
| 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 Loading... |
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 |
OLD | NEW |