Changeset 280957 in webkit
- Timestamp:
- Aug 11, 2021, 9:35:22 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (modified) (2 diffs)
-
WebKit/Shared/WebPreferencesDefaultValues.cpp (modified) (1 diff)
-
WebKit/Shared/WebPreferencesDefaultValues.h (modified) (1 diff)
-
WebKitLegacy/mac/ChangeLog (modified) (1 diff)
-
WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h (modified) (1 diff)
-
WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r280955 r280957 1 2021-08-11 Peng Liu <peng.liu6@apple.com> 2 3 Function _os_feature_enabled_impl() expects compile-time static strings as arguments 4 https://bugs.webkit.org/show_bug.cgi?id=229017 5 <rdar://81813732> 6 7 Reviewed by Tim Horton. 8 9 There are multiple issues in the current implementation of `isFeatureFlagEnabled()`. 10 1. `_os_feature_enabled_impl()` expects compile-time static strings as arguments. 11 So we should not use `String` here. 12 2. As Simon Fraser pointed out, `String::characters8()` is not null terminated. 13 14 * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm: 15 (WebKit::isFeatureFlagEnabled): 16 * Shared/WebPreferencesDefaultValues.cpp: 17 (WebKit::isFeatureFlagEnabled): 18 * Shared/WebPreferencesDefaultValues.h: 19 1 20 2021-08-11 Jean-Yves Avenard <jya@apple.com> 2 21 -
trunk/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm
r280726 r280957 39 39 40 40 // Because of <rdar://problem/60608008>, WebKit has to parse the feature flags plist file 41 bool isFeatureFlagEnabled(const String&featureName, bool defaultValue)41 bool isFeatureFlagEnabled(const char* featureName, bool defaultValue) 42 42 { 43 43 #if HAVE(SYSTEM_FEATURE_FLAGS) … … 50 50 51 51 if (isSystemWebKit) 52 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());52 return _os_feature_enabled_impl("WebKit", featureName); 53 53 54 54 return defaultValue; 55 55 #else 56 56 UNUSED_PARAM(defaultValue); 57 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());57 return _os_feature_enabled_impl("WebKit", featureName); 58 58 #endif // PLATFORM(MAC) 59 59 -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
r280726 r280957 43 43 44 44 #if !PLATFORM(COCOA) 45 bool isFeatureFlagEnabled(const String&, bool defaultValue)45 bool isFeatureFlagEnabled(const char*, bool defaultValue) 46 46 { 47 47 return defaultValue; -
trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h
r280726 r280957 36 36 namespace WebKit { 37 37 38 bool isFeatureFlagEnabled(const String&, bool defaultValue = false);38 bool isFeatureFlagEnabled(const char*, bool defaultValue = false); 39 39 40 40 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebKitLegacy/mac/ChangeLog
r280884 r280957 1 2021-08-11 Peng Liu <peng.liu6@apple.com> 2 3 Function _os_feature_enabled_impl() expects compile-time static strings as arguments 4 https://bugs.webkit.org/show_bug.cgi?id=229017 5 <rdar://81813732> 6 7 Reviewed by Tim Horton. 8 9 There are multiple issues in the current implementation of `isFeatureFlagEnabled()`. 10 1. `_os_feature_enabled_impl()` expects compile-time static strings as arguments. 11 So we should not use `String` here. 12 2. As Simon Fraser pointed out, `String::characters8()` is not null terminated. 13 14 * WebView/WebPreferencesDefaultValues.h: 15 * WebView/WebPreferencesDefaultValues.mm: 16 (WebKit::isFeatureFlagEnabled): 17 1 18 2021-08-10 Peng Liu <peng.liu6@apple.com> 2 19 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.h
r280726 r280957 37 37 38 38 #if PLATFORM(COCOA) 39 bool isFeatureFlagEnabled(const String&, bool defaultValue = false);39 bool isFeatureFlagEnabled(const char*, bool defaultValue = false); 40 40 #endif 41 41 -
trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesDefaultValues.mm
r280884 r280957 46 46 47 47 // Because of <rdar://problem/60608008>, WebKit has to parse the feature flags plist file 48 bool isFeatureFlagEnabled(const String&featureName, bool defaultValue)48 bool isFeatureFlagEnabled(const char* featureName, bool defaultValue) 49 49 { 50 50 #if HAVE(SYSTEM_FEATURE_FLAGS) … … 54 54 #if PLATFORM(COCOA) 55 55 UNUSED_PARAM(defaultValue); 56 return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8());56 return _os_feature_enabled_impl("WebKit", featureName); 57 57 #endif // PLATFORM(MAC) 58 58
Note:
See TracChangeset
for help on using the changeset viewer.