Chromium Code Reviews| 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) | |
|
jochen (gone - plz use gerrit)
2015/02/04 12:39:20
please add {}
jbroman
2015/02/04 15:49:21
Done.
| |
| 201 WebRuntimeFeatures::enableFeatureFromString( | |
| 202 blink::WebString::fromLatin1(feature), true); | |
| 203 } | |
| 204 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | |
| 205 std::vector<std::string> disabled_features; | |
| 206 base::SplitString( | |
| 207 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', | |
| 208 &disabled_features); | |
| 209 for (const std::string& feature : disabled_features) | |
|
jochen (gone - plz use gerrit)
2015/02/04 12:39:20
same here
jbroman
2015/02/04 15:49:21
Done.
| |
| 210 WebRuntimeFeatures::enableFeatureFromString( | |
| 211 blink::WebString::fromLatin1(feature), false); | |
| 212 } | |
| 189 } | 213 } |
| 190 | 214 |
| 191 } // namespace content | 215 } // namespace content |
| OLD | NEW |