From d7e9c7ca27e79e8e07aeb54b51e0b182c740fc05 Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Thu, 16 Dec 2021 21:57:23 +0000 Subject: [PATCH] Bug 1744135 Part 2: Annotate macOS font loading with font name if a crash happens. r=gfx-reviewers,jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D133426 --- gfx/thebes/gfxMacPlatformFontList.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 236f22ac4e07..3d89c421fc2b 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -394,6 +394,9 @@ CGFontRef MacOSFontEntry::CreateOrCopyFontRef() { NSString* psname = GetNSStringForString(NS_ConvertUTF8toUTF16(mName)); CGFontRef ref = CGFontCreateWithFontName(CFStringRef(psname)); if (!ref) { + CrashReporter::AutoAnnotateCrashReport autoFontName(CrashReporter::Annotation::FontName, + psname); + // This happens on macOS 10.12 for font entry names that start with // .AppleSystemUIFont. For those fonts, we need to go through NSFont // to get the correct CGFontRef. @@ -1624,6 +1627,9 @@ class MacFontInfo final : public FontInfoData { }; void MacFontInfo::LoadFontFamilyData(const nsACString& aFamilyName) { + CrashReporter::AutoAnnotateCrashReport autoFontName(CrashReporter::Annotation::FontName, + aFamilyName); + // family name ==> CTFontDescriptor NSString* famName = GetNSStringForString(NS_ConvertUTF8toUTF16(aFamilyName)); CFStringRef family = CFStringRef(famName); -- 2.11.4.GIT