Bug 1638138 - Restoring missing thread names in requestProcInfo;r=tarek

ChromeUtils::requestProcInfo was dropping thread names for the process process. This patch restores them and tests that at least *one* thread is named. Unfortunately, at the time of this writing, we cannot assume that *all*
threads are named. Investigation pending.

Differential Revision: https://phabricator.services.mozilla.com/D75420
This commit is contained in:
David Teller 2020-05-15 10:41:29 +00:00
Родитель 8b359d93c3
Коммит 62b04861d5
2 изменённых файлов: 6 добавлений и 0 удалений

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

@ -946,6 +946,7 @@ already_AddRefed<Promise> ChromeUtils::RequestProcInfo(GlobalObject& aGlobal,
thread->mCpuUser = entry.cpuUser;
thread->mCpuKernel = entry.cpuKernel;
thread->mTid = entry.tid;
thread->mName.Assign(entry.name);
}
procInfo.mThreads = std::move(threads);

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

@ -31,6 +31,11 @@ add_task(async function test_proc_info() {
cpuThreads += parentProc.threads[x].cpuUser;
}
Assert.ok(
parentProc.threads.some(thread => thread.name),
"At least one of the threads of the parent process is named"
);
for (var i = 0; i < parentProc.children.length; i++) {
let childProc = parentProc.children[i];
Assert.notEqual(