Bug 1753424 - Add SandboxingKind for UtilityProcess crash annotations r=gsvelto

Differential Revision: https://phabricator.services.mozilla.com/D140742
This commit is contained in:
Alexandre Lissy 2022-03-26 09:53:46 +00:00
Родитель 349255b6e6
Коммит 454c3f7bc3
4 изменённых файлов: 17 добавлений и 1 удалений

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

@ -144,7 +144,7 @@ RefPtr<GenericNonExclusivePromise> UtilityProcessManager::LaunchProcess(
RefPtr<UtilityProcessManager> self = this;
mLaunchPromise = mProcess->LaunchPromise()->Then(
GetMainThreadSerialEventTarget(), __func__,
[self](bool) {
[self, aSandbox](bool) {
if (self->IsShutdown()) {
return GenericNonExclusivePromise::CreateAndReject(
NS_ERROR_NOT_AVAILABLE, __func__);
@ -169,6 +169,10 @@ RefPtr<GenericNonExclusivePromise> UtilityProcessManager::LaunchProcess(
CrashReporter::AnnotateCrashReport(
CrashReporter::Annotation::UtilityProcessStatus, "Running"_ns);
CrashReporter::AnnotateCrashReport(
CrashReporter::Annotation::UtilityProcessSandboxingKind,
(unsigned int)aSandbox);
return GenericNonExclusivePromise::CreateAndResolve(true, __func__);
},
[self](nsresult aError) {

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

@ -47,6 +47,11 @@ add_task(async () => {
"Record should be a utility process crash"
);
ok(crash.id === dumpID, "Record should have an ID");
ok(
parseInt(crash.metadata.UtilityProcessSandboxingKind, 10) ===
kGenericUtility,
"Record should have the sandboxing kind value"
);
});
let minidumpDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);

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

@ -8,6 +8,8 @@ const utilityProcessTest = Cc[
"@mozilla.org/utility-process-test;1"
].createInstance(Ci.nsIUtilityProcessTest);
const kGenericUtility = 0x0;
function startUtilityProcess() {
add_task(async () => {
info("Start a UtilityProcess");

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

@ -971,6 +971,11 @@ UtilityProcessStatus:
Status of the Utility process, can be set to "Running" or "Destroyed"
type: string
UtilityProcessSandboxingKind:
description: >
The SandboxingKind passed for this Utility process instance
type: integer
Vendor:
description: >
Application vendor (e.g. Mozilla).