| 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> | 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" |
| 11 #include "base/strings/string_split.h" | 11 #include "base/strings/string_split.h" |
| 12 #include "components/scheduler/common/scheduler_switches.h" |
| 12 #include "content/common/content_switches_internal.h" | 13 #include "content/common/content_switches_internal.h" |
| 13 #include "content/public/common/content_switches.h" | 14 #include "content/public/common/content_switches.h" |
| 14 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 15 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 15 #include "ui/gl/gl_switches.h" | 16 #include "ui/gl/gl_switches.h" |
| 16 #include "ui/native_theme/native_theme_switches.h" | 17 #include "ui/native_theme/native_theme_switches.h" |
| 17 | 18 |
| 18 #if defined(OS_ANDROID) | 19 #if defined(OS_ANDROID) |
| 19 #include <cpu-features.h> | 20 #include <cpu-features.h> |
| 20 #include "base/android/build_info.h" | 21 #include "base/android/build_info.h" |
| 21 #include "base/metrics/field_trial.h" | 22 #include "base/metrics/field_trial.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( | 90 void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( |
| 90 const base::CommandLine& command_line) { | 91 const base::CommandLine& command_line) { |
| 91 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) | 92 if (command_line.HasSwitch(switches::kEnableExperimentalWebPlatformFeatures)) |
| 92 WebRuntimeFeatures::enableExperimentalFeatures(true); | 93 WebRuntimeFeatures::enableExperimentalFeatures(true); |
| 93 | 94 |
| 94 SetRuntimeFeatureDefaultsForPlatform(); | 95 SetRuntimeFeatureDefaultsForPlatform(); |
| 95 | 96 |
| 96 if (command_line.HasSwitch(switches::kDisableDatabases)) | 97 if (command_line.HasSwitch(switches::kDisableDatabases)) |
| 97 WebRuntimeFeatures::enableDatabase(false); | 98 WebRuntimeFeatures::enableDatabase(false); |
| 98 | 99 |
| 99 if (command_line.HasSwitch(switches::kDisableBlinkScheduler)) | 100 if (command_line.HasSwitch(scheduler::switches::kDisableBlinkScheduler)) |
| 100 WebRuntimeFeatures::enableBlinkScheduler(false); | 101 WebRuntimeFeatures::enableBlinkScheduler(false); |
| 101 | 102 |
| 102 if (command_line.HasSwitch(switches::kDisableLocalStorage)) | 103 if (command_line.HasSwitch(switches::kDisableLocalStorage)) |
| 103 WebRuntimeFeatures::enableLocalStorage(false); | 104 WebRuntimeFeatures::enableLocalStorage(false); |
| 104 | 105 |
| 105 if (command_line.HasSwitch(switches::kDisableMediaSource)) | 106 if (command_line.HasSwitch(switches::kDisableMediaSource)) |
| 106 WebRuntimeFeatures::enableMediaSource(false); | 107 WebRuntimeFeatures::enableMediaSource(false); |
| 107 | 108 |
| 108 if (command_line.HasSwitch(switches::kDisableNotifications)) { | 109 if (command_line.HasSwitch(switches::kDisableNotifications)) { |
| 109 WebRuntimeFeatures::enableNotifications(false); | 110 WebRuntimeFeatures::enableNotifications(false); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', | 226 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), ',', |
| 226 &disabled_features); | 227 &disabled_features); |
| 227 for (const std::string& feature : disabled_features) { | 228 for (const std::string& feature : disabled_features) { |
| 228 WebRuntimeFeatures::enableFeatureFromString( | 229 WebRuntimeFeatures::enableFeatureFromString( |
| 229 blink::WebString::fromLatin1(feature), false); | 230 blink::WebString::fromLatin1(feature), false); |
| 230 } | 231 } |
| 231 } | 232 } |
| 232 } | 233 } |
| 233 | 234 |
| 234 } // namespace content | 235 } // namespace content |
| OLD | NEW |