Bug 1738375: Annotate crash reports with Windows app package name and publisher. r=gsvelto

Depends on D130187

Differential Revision: https://phabricator.services.mozilla.com/D130188
This commit is contained in:
Ben Hearsum 2021-11-19 14:51:47 +00:00
Родитель 08c449b1cd
Коммит 62b77fa25e
3 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -87,6 +87,7 @@ Structure:
UptimeTS: <duration>, // Seconds since Firefox was started, this can have a fractional component
User32BeforeBlocklist: "1", // Windows-only, present only if user32.dll was loaded before the DLL blocklist has been initialized
WindowsErrorReporting: "1", // Windows-only, present only if the crash was intercepted by the WER runtime exception module
WindowsPackageFamilyName: <string>, // Windows-only, a string containing the "Package Family Name" of Firefox, if installed through an MSIX package
},
hasCrashEnvironment: bool
}
@ -244,3 +245,4 @@ Version History
- Firefox 90: Removed MemoryErrorCorrection (`bug 1710152 <https://bugzilla.mozilla.org/show_bug.cgi?id=1710152>`_)
and added WindowsErrorReporting (`bug 1703761 <https://bugzilla.mozilla.org/show_bug.cgi?id=1703761>`_).
- Firefox 95: Added HeadlessMode and BackgroundTaskName (`bug 1697875 <https://bugzilla.mozilla.org/show_bug.cgi?id=1697875>`_)
- Firefox 96: Added WindowsPackageFamilyName (`bug 1738375 <https://bugzilla.mozilla.org/show_bug.cgi?id=1738375>`_).

Просмотреть файл

@ -974,6 +974,15 @@ WasmLibrarySandboxMallocFailed:
Set to 1 if a rlbox wasm library sandbox ran out of memory, causing a
malloc inside the sandbox to fail.
type: boolean
WindowsPackageFamilyName:
description: >
If running in a Windows package context, the package family name, per
https://docs.microsoft.com/en-us/windows/win32/api/appmodel/nf-appmodel-getcurrentpackagefamilyname.
The package family name is only included when it is likely to have been produced by Mozilla: it
starts "Mozilla." or "MozillaCorporation.".
type: string
ping: true
WindowsErrorReporting:

Просмотреть файл

@ -3803,6 +3803,14 @@ int XREMain::XRE_mainInit(bool* aExitFlag) {
CrashReporter::AnnotateCrashReport(CrashReporter::Annotation::AppInitDLLs,
NS_ConvertUTF16toUTF8(appInitDLLs));
}
nsString packageFamilyName = widget::WinUtils::GetPackageFamilyName();
if (StringBeginsWith(packageFamilyName, u"Mozilla."_ns) ||
StringBeginsWith(packageFamilyName, u"MozillaCorporation."_ns)) {
CrashReporter::AnnotateCrashReport(
CrashReporter::Annotation::WindowsPackageFamilyName,
NS_ConvertUTF16toUTF8(packageFamilyName));
}
#endif
bool isBackgroundTaskMode = false;