-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Check hash map keys before adding to map #47123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check hash map keys before adding to map #47123
Conversation
EWS run on previous version of this PR (hash 408c68a) |
fontURLs.add(fontFamilyName.convertToASCIILowercase(), fontURL); | ||
auto lowerCaseFontName = fontName.convertToASCIILowercase(); | ||
auto lowerCaseFontFamilyName = fontFamilyName.convertToASCIILowercase(); | ||
if (lowerCaseFontName.isEmpty() || lowerCaseFontFamilyName.isEmpty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chance one is null but not the other? And it that case, wouldn't we want to add the non-null one to the HashMap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point! Will fix.
Thanks for reviewing!
408c68a
to
d1b9e72
Compare
EWS run on current version of this PR (hash d1b9e72) |
fontURLs.add(fontFamilyName.convertToASCIILowercase(), fontURL); | ||
didAddFontToMap = true; | ||
auto lowerCaseFontName = fontName.convertToASCIILowercase(); | ||
if (!lowerCaseFontName.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this API-testable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good point! It requires an invalid user installed font, so it may not be trivial, but it's definitely doable. If time permits, I will look into creating an API test for this.
Thanks for reviewing!
https://bugs.webkit.org/show_bug.cgi?id=294911 rdar://154104621 Reviewed by Chris Dumez. * Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::addUserInstalledFontURLs): Canonical link: https://commits.webkit.org/296587@main
d1b9e72
to
b13bdfd
Compare
Committed 296587@main (b13bdfd): https://commits.webkit.org/296587@main Reviewed commits have been landed. Closing PR #47123 and removing active labels. |
b13bdfd
d1b9e72