Bug 1605973 - Show shutdown blockers in RemoteSettings worker r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D64101

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mathieu Leplatre 2020-02-25 15:47:33 +00:00
Родитель 85403a9f37
Коммит 88640634af
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -71,7 +71,7 @@ class Worker {
clearTimeout(this.idleTimeoutId);
}
return new Promise((resolve, reject) => {
const callbackId = ++this.lastCallbackId;
const callbackId = `${method}-${++this.lastCallbackId}`;
this.callbacks.set(callbackId, [resolve, reject]);
this.worker.postMessage({ callbackId, method, args });
});
@ -156,7 +156,9 @@ try {
},
{
fetchState() {
return `Remaining: ${RemoteSettingsWorker.callbacks.size} callbacks.`;
const remainingCallbacks = RemoteSettingsWorker.callbacks;
const details = Array.from(remainingCallbacks.keys()).join(", ");
return `Remaining: ${remainingCallbacks.size} callbacks (${details}).`;
},
}
);