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> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "content/common/content_switches_internal.h" | 15 #include "content/common/content_switches_internal.h" |
| 16 #include "content/public/common/content_features.h" | 16 #include "content/public/common/content_features.h" |
| 17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 18 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 19 #include "ui/gl/gl_switches.h" | 19 #include "ui/gl/gl_switches.h" |
| 20 #include "ui/native_theme/native_theme_switches.h" | 20 #include "ui/native_theme/native_theme_switches.h" |
| 21 | 21 |
| 22 #if defined(OS_ANDROID) | |
| 23 #include <cpu-features.h> | |
| 24 #include "base/android/build_info.h" | |
| 25 #include "media/base/android/media_codec_util.h" | |
| 26 #endif | |
| 27 | |
| 28 using blink::WebRuntimeFeatures; | 22 using blink::WebRuntimeFeatures; |
| 29 | 23 |
| 30 namespace content { | 24 namespace content { |
| 31 | 25 |
| 32 static void SetRuntimeFeatureDefaultsForPlatform() { | 26 static void SetRuntimeFeatureDefaultsForPlatform() { |
| 33 #if defined(OS_ANDROID) | 27 #if defined(OS_ANDROID) |
| 34 // EME implementation needs Android MediaCodec API. | |
| 35 if (!media::MediaCodecUtil::IsMediaCodecAvailable()) { | |
| 36 WebRuntimeFeatures::enableEncryptedMedia(false); | |
| 37 } | |
|
xhwang
2016/02/27 01:42:45
So will we just reject all rMKSA calls on platform
ddorwin
2016/02/27 01:49:02
For Clear Key (with the unified media pipeline), e
ddorwin
2016/02/27 05:23:44
I posted my thoughts in https://bugs.chromium.org/
| |
| 38 | |
| 39 // Android does not have support for PagePopup | 28 // Android does not have support for PagePopup |
| 40 WebRuntimeFeatures::enablePagePopup(false); | 29 WebRuntimeFeatures::enablePagePopup(false); |
| 41 // Android does not yet support SharedWorker. crbug.com/154571 | 30 // Android does not yet support SharedWorker. crbug.com/154571 |
| 42 WebRuntimeFeatures::enableSharedWorker(false); | 31 WebRuntimeFeatures::enableSharedWorker(false); |
| 43 // Android does not yet support NavigatorContentUtils. | 32 // Android does not yet support NavigatorContentUtils. |
| 44 WebRuntimeFeatures::enableNavigatorContentUtils(false); | 33 WebRuntimeFeatures::enableNavigatorContentUtils(false); |
| 45 WebRuntimeFeatures::enableOrientationEvent(true); | 34 WebRuntimeFeatures::enableOrientationEvent(true); |
| 46 WebRuntimeFeatures::enableFastMobileScrolling(true); | 35 WebRuntimeFeatures::enableFastMobileScrolling(true); |
| 47 WebRuntimeFeatures::enableMediaCapture(true); | 36 WebRuntimeFeatures::enableMediaCapture(true); |
| 48 // Android won't be able to reliably support non-persistent notifications, the | 37 // Android won't be able to reliably support non-persistent notifications, the |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 74 WebRuntimeFeatures::enableExperimentalFramework(true); | 63 WebRuntimeFeatures::enableExperimentalFramework(true); |
| 75 | 64 |
| 76 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) | 65 if (command_line.HasSwitch(switches::kEnableWebBluetooth)) |
| 77 WebRuntimeFeatures::enableWebBluetooth(true); | 66 WebRuntimeFeatures::enableWebBluetooth(true); |
| 78 | 67 |
| 79 SetRuntimeFeatureDefaultsForPlatform(); | 68 SetRuntimeFeatureDefaultsForPlatform(); |
| 80 | 69 |
| 81 if (command_line.HasSwitch(switches::kDisableDatabases)) | 70 if (command_line.HasSwitch(switches::kDisableDatabases)) |
| 82 WebRuntimeFeatures::enableDatabase(false); | 71 WebRuntimeFeatures::enableDatabase(false); |
| 83 | 72 |
| 84 if (command_line.HasSwitch(switches::kDisableMediaSource)) | |
| 85 WebRuntimeFeatures::enableMediaSource(false); | |
| 86 | |
| 87 if (command_line.HasSwitch(switches::kDisableNotifications)) { | 73 if (command_line.HasSwitch(switches::kDisableNotifications)) { |
| 88 WebRuntimeFeatures::enableNotifications(false); | 74 WebRuntimeFeatures::enableNotifications(false); |
| 89 | 75 |
| 90 // Chrome's Push Messaging implementation relies on Web Notifications. | 76 // Chrome's Push Messaging implementation relies on Web Notifications. |
| 91 WebRuntimeFeatures::enablePushMessaging(false); | 77 WebRuntimeFeatures::enablePushMessaging(false); |
| 92 } | 78 } |
| 93 | 79 |
| 94 if (command_line.HasSwitch(switches::kEnableNotificationActionIcons)) | 80 if (command_line.HasSwitch(switches::kEnableNotificationActionIcons)) |
| 95 WebRuntimeFeatures::enableNotificationActionIcons(true); | 81 WebRuntimeFeatures::enableNotificationActionIcons(true); |
| 96 | 82 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 192 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { | 178 if (command_line.HasSwitch(switches::kDisableBlinkFeatures)) { |
| 193 std::vector<std::string> disabled_features = base::SplitString( | 179 std::vector<std::string> disabled_features = base::SplitString( |
| 194 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), | 180 command_line.GetSwitchValueASCII(switches::kDisableBlinkFeatures), |
| 195 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); | 181 ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
| 196 for (const std::string& feature : disabled_features) | 182 for (const std::string& feature : disabled_features) |
| 197 WebRuntimeFeatures::enableFeatureFromString(feature, false); | 183 WebRuntimeFeatures::enableFeatureFromString(feature, false); |
| 198 } | 184 } |
| 199 } | 185 } |
| 200 | 186 |
| 201 } // namespace content | 187 } // namespace content |
| OLD | NEW |