Changeset 280726 in webkit
- Timestamp:
- Aug 6, 2021, 9:38:28 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt (deleted)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/FeatureFlags/WebKit-appletvos.plist (modified) (2 diffs)
-
Source/WebKit/FeatureFlags/WebKit-ios.plist (modified) (2 diffs)
-
Source/WebKit/FeatureFlags/WebKit-macos.plist (modified) (2 diffs)
-
Source/WebKit/FeatureFlags/WebKit-watchos.plist (modified) (2 diffs)
-
Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (modified) (2 diffs)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (modified) (9 diffs)
-
Source/WebKit/Shared/WebPreferencesDefaultValues.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
Source/WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h (modified) (1 diff)
-
Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280721 r280726 1 2021-08-06 Peng Liu <peng.liu6@apple.com> 2 3 [macOS] Clean up Feature Flags related code 4 https://bugs.webkit.org/show_bug.cgi?id=228803 5 <rdar://problem/81142982> 6 7 Reviewed by Tim Horton. 8 9 Update a mac-bigsur specific test expectation file because the test is passing now. 10 11 * platform/mac/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: Removed. 12 * platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt: 13 1 14 2021-08-06 Antti Koivisto <antti@apple.com> 2 15 -
trunk/LayoutTests/platform/mac-bigsur/imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-expected.txt
r270720 r280726 4 4 PASS Test addSourceBuffer() with null 5 5 PASS Test addSourceBuffer() with unsupported type 6 FAIL Test addSourceBuffer() with Vorbis and VP8 assert_true: video/webm;codecs="vp8,vorbis" is supported expected true got false 7 FAIL Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers assert_true: audio/webm;codecs="vorbis" is supported expected true got false 6 PASS Test addSourceBuffer() with Vorbis and VP8 7 PASS Test addSourceBuffer() with Vorbis and VP8 in separate SourceBuffers 8 8 PASS Test addSourceBuffer() video only 9 9 PASS Test addSourceBuffer() audio only -
trunk/Source/WebKit/ChangeLog
r280723 r280726 1 2021-08-06 Peng Liu <peng.liu6@apple.com> 2 3 [macOS] Clean up Feature Flags related code 4 https://bugs.webkit.org/show_bug.cgi?id=228803 5 <rdar://problem/81142982> 6 7 Reviewed by Tim Horton. 8 9 On macOS, Safari Technology Preview or a local build WebKit/Safari will always 10 get the default preference values through the "Feature Flags" SPI. Unfortunately, 11 this approach won't work if the OS does not provide correct default preference values. 12 13 With this patch, we only get default preference values with the SPI for system 14 WebKit on macOS. For all other cases, we use hardcoded values. So that 15 WebKit will always get the correct default preference values. 16 17 This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder". 18 19 * FeatureFlags/WebKit-appletvos.plist: 20 * FeatureFlags/WebKit-ios.plist: 21 * FeatureFlags/WebKit-macos.plist: 22 * FeatureFlags/WebKit-watchos.plist: 23 24 * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm: 25 (WebKit::isFeatureFlagEnabled): 26 * Shared/WebPreferencesDefaultValues.cpp: 27 (WebKit::isFeatureFlagEnabled): 28 (WebKit::defaultAsyncFrameAndOverflowScrollingEnabled): 29 (WebKit::defaultUseGPUProcessForCanvasRenderingEnabled): 30 (WebKit::defaultUseGPUProcessForDOMRenderingEnabled): 31 (WebKit::defaultUseGPUProcessForMediaEnabled): 32 (WebKit::defaultUseGPUProcessForWebGLEnabled): 33 (WebKit::defaultCaptureAudioInGPUProcessEnabled): 34 (WebKit::defaultCaptureVideoInGPUProcessEnabled): 35 (WebKit::defaultWebRTCCodecsInGPUProcess): 36 (WebKit::defaultIncrementalPDFEnabled): 37 (WebKit::defaultWebMFormatReaderEnabled): 38 (WebKit::defaultVP8DecoderEnabled): 39 (WebKit::defaultVP9DecoderEnabled): 40 (WebKit::defaultVP9SWDecoderEnabledOnBattery): 41 (WebKit::defaultWebMParserEnabled): 42 (WebKit::defaultWebMWebAudioEnabled): 43 (WebKit::defaultInAppBrowserPrivacy): Deleted. 44 * Shared/WebPreferencesDefaultValues.h: 45 46 * UIProcess/WebPageProxy.cpp: 47 (WebKit::WebPageProxy::creationParameters): Fix a typo. 48 1 49 2021-08-06 Jer Noble <jer.noble@apple.com> 2 50 -
trunk/Source/WebKit/FeatureFlags/WebKit-appletvos.plist
r280467 r280726 68 68 <true/> 69 69 </dict> 70 <key>vp8_decoder</key> 71 <dict> 72 <key>Enabled</key> 73 <true/> 74 </dict> 70 75 <key>WebXR</key> 71 76 <dict> … … 83 88 <true/> 84 89 </dict> 85 <key>webm_webaudio</key>86 <dict>87 <key>Enabled</key>88 <true/>89 </dict>90 90 <key>RB_full_manage_WK_jetsam</key> 91 91 <dict> -
trunk/Source/WebKit/FeatureFlags/WebKit-ios.plist
r280467 r280726 68 68 <true/> 69 69 </dict> 70 <key>vp8_decoder</key> 71 <dict> 72 <key>Enabled</key> 73 <true/> 74 </dict> 70 75 <key>WebXR</key> 71 76 <dict> … … 83 88 <true/> 84 89 </dict> 85 <key>webm_webaudio</key>86 <dict>87 <key>Enabled</key>88 <true/>89 </dict>90 90 <key>RB_full_manage_WK_jetsam</key> 91 91 <dict> -
trunk/Source/WebKit/FeatureFlags/WebKit-macos.plist
r280467 r280726 68 68 <true/> 69 69 </dict> 70 <key>vp8_decoder</key> 71 <dict> 72 <key>Enabled</key> 73 <true/> 74 </dict> 70 75 <key>WebXR</key> 71 76 <dict> … … 86 91 <dict> 87 92 <key>Enabled</key> 88 < true/>93 <false/> 89 94 </dict> 90 95 <key>RB_full_manage_WK_jetsam</key> -
trunk/Source/WebKit/FeatureFlags/WebKit-watchos.plist
r280467 r280726 68 68 <true/> 69 69 </dict> 70 <key>vp8_decoder</key> 71 <dict> 72 <key>Enabled</key> 73 <true/> 74 </dict> 70 75 <key>WebXR</key> 71 76 <dict> … … 83 88 <true/> 84 89 </dict> 85 <key>webm_webaudio</key>86 <dict>87 <key>Enabled</key>88 <true/>89 </dict>90 90 <key>RB_full_manage_WK_jetsam</key> 91 91 <dict> -
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm
r280433 r280726 27 27 #import "WebPreferencesDefaultValues.h" 28 28 29 #if PLATFORM(COCOA) && HAVE(SYSTEM_FEATURE_FLAGS)29 #if PLATFORM(COCOA) 30 30 31 31 #import <Foundation/NSBundle.h> … … 39 39 40 40 // Because of <rdar://problem/60608008>, WebKit has to parse the feature flags plist file 41 bool isFeatureFlagEnabled(const String& featureName )41 bool isFeatureFlagEnabled(const String& featureName, bool defaultValue) 42 42 { 43 static bool isWebKitBundleFromStagedFramework = [] { 44 NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")]; 45 return [webkit2Bundle.bundlePath hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari/"]; 43 #if HAVE(SYSTEM_FEATURE_FLAGS) 44 45 #if PLATFORM(MAC) 46 static bool isSystemWebKit = [] { 47 NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")]; 48 return [bundle.bundlePath hasPrefix:@"/System/"]; 46 49 }(); 47 50 48 if (!isWebKitBundleFromStagedFramework) 49 return _os_feature_enabled_impl("WebKit", (const char*)featureName.utf8().data()); 50 51 static NeverDestroyed<RetainPtr<NSDictionary>> dictionary = [NSDictionary dictionaryWithContentsOfFile:@"/Library/Apple/System/Library/FeatureFlags/Domain/WebKit.plist"]; 52 53 if (![[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"]) 51 if (isSystemWebKit) 54 52 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); 55 53 56 return [[[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"] isKindOfClass:[NSNumber class]] && [[[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"] boolValue]; 54 return defaultValue; 55 #else 56 UNUSED_PARAM(defaultValue); 57 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); 58 #endif // PLATFORM(MAC) 59 60 #else 61 62 UNUSED_PARAM(featureName); 63 return defaultValue; 64 65 #endif // HAVE(SYSTEM_FEATURE_FLAGS) 57 66 } 58 67 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
r280467 r280726 42 42 namespace WebKit { 43 43 44 #if !PLATFORM(COCOA) 45 bool isFeatureFlagEnabled(const String&, bool defaultValue) 46 { 47 return defaultValue; 48 } 49 #endif 50 44 51 #if PLATFORM(IOS_FAMILY) 45 52 … … 109 116 #endif 110 117 111 #if HAVE(SYSTEM_FEATURE_FLAGS) 112 return isFeatureFlagEnabled("async_frame_and_overflow_scrolling"); 113 #endif 114 115 #if PLATFORM(MAC) 116 return true; 117 #endif 118 119 return false; 118 #if PLATFORM(MAC) 119 bool defaultValue = true; 120 #else 121 bool defaultValue = false; 122 #endif 123 124 return isFeatureFlagEnabled("async_frame_and_overflow_scrolling", defaultValue); 120 125 } 121 126 … … 151 156 { 152 157 #if ENABLE(GPU_PROCESS_BY_DEFAULT) 153 #if HAVE(SYSTEM_FEATURE_FLAGS) 154 return isFeatureFlagEnabled("gpu_process_canvas_rendering"); 155 #else 156 return true; 157 #endif // HAVE(SYSTEM_FEATURE_FLAGS) 158 #else 158 bool defaultValue = true; 159 #else 160 bool defaultValue = false; 161 #endif 162 163 return isFeatureFlagEnabled("gpu_process_canvas_rendering", defaultValue); 164 } 165 166 bool defaultUseGPUProcessForDOMRenderingEnabled() 167 { 168 return isFeatureFlagEnabled("gpu_process_dom_rendering", false); 169 } 170 171 bool defaultUseGPUProcessForMediaEnabled() 172 { 173 #if ENABLE(GPU_PROCESS_BY_DEFAULT) 174 bool defaultValue = true; 175 #else 176 bool defaultValue = false; 177 #endif 178 179 return isFeatureFlagEnabled("gpu_process_media", defaultValue); 180 } 181 182 bool defaultUseGPUProcessForWebGLEnabled() 183 { 184 return isFeatureFlagEnabled("gpu_process_webgl", false); 185 } 186 187 #endif // ENABLE(GPU_PROCESS) 188 189 #if ENABLE(MEDIA_STREAM) 190 191 bool defaultCaptureAudioInGPUProcessEnabled() 192 { 193 #if ENABLE(GPU_PROCESS_BY_DEFAULT) 194 bool defaultValue = true; 195 #else 196 bool defaultValue = false; 197 #endif 198 199 #if PLATFORM(MAC) 200 return isFeatureFlagEnabled("gpu_process_webrtc", defaultValue); 201 #elif PLATFORM(IOS_FAMILY) 202 return isFeatureFlagEnabled("gpu_process_media", defaultValue); 203 #else 204 return defaultValue; 205 #endif 206 } 207 208 bool defaultCaptureAudioInUIProcessEnabled() 209 { 210 #if PLATFORM(MAC) 211 return !defaultCaptureAudioInGPUProcessEnabled(); 212 #endif 213 159 214 return false; 160 #endif161 }162 163 bool defaultUseGPUProcessForDOMRenderingEnabled()164 {165 #if ENABLE(GPU_PROCESS_BY_DEFAULT)166 #if HAVE(SYSTEM_FEATURE_FLAGS)167 return isFeatureFlagEnabled("gpu_process_dom_rendering");168 #else169 return false;170 #endif // HAVE(SYSTEM_FEATURE_FLAGS)171 #else172 return false;173 #endif174 }175 176 bool defaultUseGPUProcessForMediaEnabled()177 {178 #if ENABLE(GPU_PROCESS_BY_DEFAULT)179 #if HAVE(SYSTEM_FEATURE_FLAGS)180 return isFeatureFlagEnabled("gpu_process_media");181 #else182 return true;183 #endif // HAVE(SYSTEM_FEATURE_FLAGS)184 #else185 return false;186 #endif187 }188 189 bool defaultUseGPUProcessForWebGLEnabled()190 {191 #if HAVE(SYSTEM_FEATURE_FLAGS)192 return isFeatureFlagEnabled("gpu_process_webgl");193 #endif194 195 return false;196 }197 198 #endif // ENABLE(GPU_PROCESS)199 200 #if ENABLE(MEDIA_STREAM)201 202 bool defaultCaptureAudioInGPUProcessEnabled()203 {204 #if ENABLE(GPU_PROCESS_BY_DEFAULT)205 206 #if HAVE(SYSTEM_FEATURE_FLAGS)207 #if PLATFORM(MAC)208 return isFeatureFlagEnabled("gpu_process_webrtc");209 #elif PLATFORM(IOS_FAMILY)210 return isFeatureFlagEnabled("gpu_process_media");211 #endif212 #else213 return true;214 #endif // HAVE(SYSTEM_FEATURE_FLAGS)215 216 #else217 return false;218 #endif219 }220 221 bool defaultCaptureAudioInUIProcessEnabled()222 {223 #if PLATFORM(MAC)224 return !defaultCaptureAudioInGPUProcessEnabled();225 #endif226 227 return false;228 215 } 229 216 … … 231 218 { 232 219 #if ENABLE(GPU_PROCESS_BY_DEFAULT) 233 #if HAVE(SYSTEM_FEATURE_FLAGS) 234 return isFeatureFlagEnabled("gpu_process_webrtc"); 235 #else 236 return true; 237 #endif // HAVE(SYSTEM_FEATURE_FLAGS) 238 #else 239 return false; 240 #endif 220 bool defaultValue = true; 221 #else 222 bool defaultValue = false; 223 #endif 224 225 return isFeatureFlagEnabled("gpu_process_webrtc", defaultValue); 241 226 } 242 227 … … 248 233 { 249 234 #if ENABLE(GPU_PROCESS_BY_DEFAULT) 250 #if HAVE(SYSTEM_FEATURE_FLAGS) 251 return isFeatureFlagEnabled("gpu_process_webrtc"); 252 #else 253 return true; 254 #endif // HAVE(SYSTEM_FEATURE_FLAGS) 255 #else 256 return false; 257 #endif 235 bool defaultValue = true; 236 #else 237 bool defaultValue = false; 238 #endif 239 240 return isFeatureFlagEnabled("gpu_process_webrtc", defaultValue); 258 241 } 259 242 260 243 #endif // ENABLE(WEB_RTC) 261 262 bool defaultInAppBrowserPrivacy()263 {264 #if HAVE(SYSTEM_FEATURE_FLAGS)265 return isFeatureFlagEnabled("InAppBrowserPrivacy");266 #endif267 268 return false;269 }270 244 271 245 #if HAVE(INCREMENTAL_PDF_APIS) 272 246 bool defaultIncrementalPDFEnabled() 273 247 { 274 #if HAVE(SYSTEM_FEATURE_FLAGS) 275 return isFeatureFlagEnabled("incremental_pdf"); 276 #endif 277 278 #if PLATFORM(MAC) 248 #if PLATFORM(MAC) 249 bool defaultValue = true; 250 #else 251 bool defaultValue = false; 252 #endif 253 254 return isFeatureFlagEnabled("incremental_pdf", defaultValue); 255 } 256 #endif 257 258 #if ENABLE(WEBXR) 259 260 bool defaultWebXREnabled() 261 { 262 #if HAVE(WEBXR_INTERNALS) 279 263 return true; 280 264 #else … … 282 266 #endif 283 267 } 284 #endif285 286 #if ENABLE(WEBXR)287 288 bool defaultWebXREnabled()289 {290 #if HAVE(WEBXR_INTERNALS)291 return true;292 #else293 return false;294 #endif295 }296 268 297 269 #endif // ENABLE(WEBXR) … … 301 273 bool defaultWebMFormatReaderEnabled() 302 274 { 303 #if HAVE(SYSTEM_FEATURE_FLAGS) 304 return isFeatureFlagEnabled("webm_format_reader"); 305 #endif 306 307 #if PLATFORM(MAC) 308 return true; 309 #else 310 return false; 311 #endif 275 #if PLATFORM(MAC) 276 bool defaultValue = true; 277 #else 278 bool defaultValue = false; 279 #endif 280 281 return isFeatureFlagEnabled("webm_format_reader", defaultValue); 312 282 } 313 283 … … 318 288 bool defaultVP8DecoderEnabled() 319 289 { 320 #if HAVE(SYSTEM_FEATURE_FLAGS) 321 return isFeatureFlagEnabled("vp8_decoder"); 322 #endif 323 324 return false; 290 return isFeatureFlagEnabled("vp8_decoder", true); 325 291 } 326 292 327 293 bool defaultVP9DecoderEnabled() 328 294 { 329 #if HAVE(SYSTEM_FEATURE_FLAGS) 330 return isFeatureFlagEnabled("vp9_decoder"); 331 #endif 332 333 return true; 295 return isFeatureFlagEnabled("vp9_decoder", true); 334 296 } 335 297 336 298 bool defaultVP9SWDecoderEnabledOnBattery() 337 299 { 338 #if HAVE(SYSTEM_FEATURE_FLAGS) 339 return isFeatureFlagEnabled("sw_vp9_decoder_on_battery"); 340 #endif 341 342 return false; 300 return isFeatureFlagEnabled("sw_vp9_decoder_on_battery", false); 343 301 } 344 302 #endif // ENABLE(VP9) … … 348 306 bool defaultWebMParserEnabled() 349 307 { 350 #if HAVE(SYSTEM_FEATURE_FLAGS) 351 return isFeatureFlagEnabled("webm_parser"); 352 #endif 353 354 return true; 308 return isFeatureFlagEnabled("webm_parser", true); 355 309 } 356 310 357 311 bool defaultWebMWebAudioEnabled() 358 312 { 359 #if HAVE(SYSTEM_FEATURE_FLAGS) 360 return isFeatureFlagEnabled("webm_webaudio"); 361 #endif 362 363 return false; 313 return isFeatureFlagEnabled("webm_webaudio", false); 364 314 } 365 315 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r280467 r280726 36 36 namespace WebKit { 37 37 38 #if HAVE(SYSTEM_FEATURE_FLAGS) 39 bool isFeatureFlagEnabled(const String&); 40 #endif 38 bool isFeatureFlagEnabled(const String&, bool defaultValue = false); 41 39 42 40 #if PLATFORM(IOS_FAMILY) … … 86 84 #endif 87 85 88 bool defaultInAppBrowserPrivacy();89 90 86 #if HAVE(INCREMENTAL_PDF_APIS) 91 87 bool defaultIncrementalPDFEnabled(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r280374 r280726 8240 8240 #if ENABLE(VP9) && PLATFORM(COCOA) 8241 8241 // FIXME: This is also being passed over the to WebProcess via the PreferencesStore. 8242 parameters.shouldEnableVP8Decoder = preferences().vp 9DecoderEnabled();8242 parameters.shouldEnableVP8Decoder = preferences().vp8DecoderEnabled(); 8243 8243 // FIXME: This is also being passed over the to WebProcess via the PreferencesStore. 8244 8244 parameters.shouldEnableVP9SWDecoder = preferences().vp9DecoderEnabled() && (!WebCore::systemHasBattery() || preferences().vp9SWDecoderEnabledOnBattery()); -
trunk/Source/WebKitLegacy/mac/ChangeLog
r280718 r280726 1 2021-08-06 Peng Liu <peng.liu6@apple.com> 2 3 [macOS] Clean up Feature Flags related code 4 https://bugs.webkit.org/show_bug.cgi?id=228803 5 <rdar://problem/81142982> 6 7 Reviewed by Tim Horton. 8 9 On macOS, Safari Technology Preview or a local build WebKit/Safari will always 10 get the default preference values through the "Feature Flags" SPI. Unfortunately, 11 this approach won't work if the OS does not provide correct default preference values. 12 13 With this patch, we only get default preference values with the SPI for system 14 WebKit on macOS. For all other cases, we use hardcoded values. So that 15 WebKit will always get the correct default preference values. 16 17 This patch also fixes a few mistakes in two preferences: "webm_webaudio" and "vp8_decoder". 18 19 * WebView/WebPreferencesDefaultValues.h: 20 * WebView/WebPreferencesDefaultValues.mm: 21 (WebKit::isFeatureFlagEnabled): 22 (WebKit::defaultIncrementalPDFEnabled): 23 (WebKit::defaultWebXREnabled): 24 (WebKit::defaultWebMParserEnabled): 25 (WebKit::defaultWebMWebAudioEnabled): 26 (WebKit::defaultVP8DecoderEnabled): 27 (WebKit::defaultVP9DecoderEnabled): 28 1 29 2021-08-05 Cameron McCormack <heycam@apple.com> 2 30 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
r280467 r280726 36 36 namespace WebKit { 37 37 38 #if PLATFORM(COCOA) && HAVE(SYSTEM_FEATURE_FLAGS)39 bool isFeatureFlagEnabled(const String& );38 #if PLATFORM(COCOA) 39 bool isFeatureFlagEnabled(const String&, bool defaultValue = false); 40 40 #endif 41 41 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm
r280467 r280726 43 43 namespace WebKit { 44 44 45 #if PLATFORM(COCOA) && HAVE(SYSTEM_FEATURE_FLAGS)45 #if PLATFORM(COCOA) 46 46 47 47 // Because of <rdar://problem/60608008>, WebKit has to parse the feature flags plist file 48 bool isFeatureFlagEnabled(const String& featureName) 49 { 50 BOOL isWebKitBundleFromStagedFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/WebKit"]; 51 52 if (!isWebKitBundleFromStagedFramework) 53 return _os_feature_enabled_impl("WebKit", (const char*)featureName.utf8().data()); 54 55 static NeverDestroyed<RetainPtr<NSDictionary>> dictionary = [NSDictionary dictionaryWithContentsOfFile:@"/Library/Apple/System/Library/FeatureFlags/Domain/WebKit.plist"]; 56 57 if (![[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"]) 48 bool isFeatureFlagEnabled(const String& featureName, bool defaultValue) 49 { 50 #if HAVE(SYSTEM_FEATURE_FLAGS) 51 52 #if PLATFORM(MAC) 53 static bool isSystemWebKit = [] { 54 NSBundle *bundle = [NSBundle bundleForClass:NSClassFromString(@"WebView")]; 55 return [bundle.bundlePath hasPrefix:@"/System/"]; 56 }(); 57 58 if (isSystemWebKit) 58 59 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); 59 60 60 return [[[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"] isKindOfClass:[NSNumber class]] && [[[dictionary.get() objectForKey:featureName] objectForKey:@"Enabled"] boolValue]; 61 return defaultValue; 62 #else 63 UNUSED_PARAM(defaultValue); 64 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); 65 #endif // PLATFORM(MAC) 66 67 #else 68 69 UNUSED_PARAM(featureName); 70 return defaultValue; 71 72 #endif // HAVE(SYSTEM_FEATURE_FLAGS) 61 73 } 62 74 … … 67 79 bool defaultIncrementalPDFEnabled() 68 80 { 69 #if HAVE(SYSTEM_FEATURE_FLAGS) 70 return isFeatureFlagEnabled("incremental_pdf"); 71 #endif 72 73 return false; 81 return isFeatureFlagEnabled("incremental_pdf", false); 74 82 } 75 83 … … 80 88 bool defaultWebXREnabled() 81 89 { 82 #if HAVE(SYSTEM_FEATURE_FLAGS) 83 return isFeatureFlagEnabled("WebXR"); 84 #endif 85 86 return false; 90 return isFeatureFlagEnabled("WebXR", false); 87 91 } 88 92 … … 279 283 bool defaultWebMParserEnabled() 280 284 { 281 #if HAVE(SYSTEM_FEATURE_FLAGS) 282 return isFeatureFlagEnabled("webm_parser"); 283 #endif 284 285 return true; 285 return isFeatureFlagEnabled("webm_parser", true); 286 286 } 287 287 288 288 bool defaultWebMWebAudioEnabled() 289 289 { 290 #if HAVE(SYSTEM_FEATURE_FLAGS) 291 return isFeatureFlagEnabled("webm_webaudio"); 292 #endif 293 294 return false; 290 return isFeatureFlagEnabled("webm_webaudio", false); 295 291 } 296 292 … … 301 297 bool defaultVP8DecoderEnabled() 302 298 { 303 #if HAVE(SYSTEM_FEATURE_FLAGS) 304 return isFeatureFlagEnabled("vp8_decoder"); 305 #endif 306 307 return false; 299 return isFeatureFlagEnabled("vp8_decoder", true); 308 300 } 309 301 310 302 bool defaultVP9DecoderEnabled() 311 303 { 312 #if HAVE(SYSTEM_FEATURE_FLAGS) 313 return isFeatureFlagEnabled("vp9_decoder"); 314 #endif 315 316 return true; 304 return isFeatureFlagEnabled("vp9_decoder", true); 317 305 } 318 306
Note:
See TracChangeset
for help on using the changeset viewer.