RESOLVED FIXED 211457
Add the feature flag plist file parser
https://bugs.webkit.org/show_bug.cgi?id=211457
Summary Add the feature flag plist file parser
Peng Liu
Reported 2020-05-05 11:22:38 PDT
Add the feature flag plist file parser
Attachments
Patch (11.48 KB, patch)
2020-05-05 11:28 PDT, Peng Liu
thorton: review+
Revised patch based on Tim's comments (14.81 KB, patch)
2020-05-12 19:42 PDT, Peng Liu
no flags
Peng Liu
Comment 1 2020-05-05 11:23:17 PDT
Peng Liu
Comment 2 2020-05-05 11:28:18 PDT
Tim Horton
Comment 3 2020-05-12 17:50:28 PDT
Comment on attachment 398531 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398531&action=review > Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:41 > +bool featureFlagEnabled(const String& featureName) maybe a leading is-? I'm not sure > Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:43 > + BOOL isWebKitBundleFromStageFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/WebKit"]; "staged", not "stage" > Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:46 > + return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); I think you want `.utf8().data()`, no? > Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:50 > + if ([[dictionary objectForKey:featureName] objectForKey:@"Enabled"] == nil) normally we use if (!x) instead of if (x == nil) > Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:53 > + return [[[dictionary objectForKey:featureName] objectForKey:@"Enabled"] boolValue]; Do you want to make sure it's an NSNumber before calling -boolValue?
Peng Liu
Comment 4 2020-05-12 19:42:37 PDT
Created attachment 399233 [details] Revised patch based on Tim's comments
Peng Liu
Comment 5 2020-05-12 22:21:00 PDT
Comment on attachment 398531 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=398531&action=review >> Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:41 >> +bool featureFlagEnabled(const String& featureName) > > maybe a leading is-? I'm not sure Renamed to isFeatureFlagEnabled(). >> Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:43 >> + BOOL isWebKitBundleFromStageFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/WebKit"]; > > "staged", not "stage" Fixed. >> Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:46 >> + return _os_feature_enabled_impl("WebKit", (const char*)featureName.characters8()); > > I think you want `.utf8().data()`, no? Right, fixed. >> Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:50 >> + if ([[dictionary objectForKey:featureName] objectForKey:@"Enabled"] == nil) > > normally we use if (!x) instead of if (x == nil) Fixed. >> Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:53 >> + return [[[dictionary objectForKey:featureName] objectForKey:@"Enabled"] boolValue]; > > Do you want to make sure it's an NSNumber before calling -boolValue? Fixed.
EWS
Comment 6 2020-05-12 22:35:44 PDT
Committed r261599: <https://trac.webkit.org/changeset/261599> All reviewed patches have been landed. Closing bug and clearing flags on attachment 399233 [details].
Note You need to log in before you can comment on or make changes to this bug.