Bug 1967273 - Reject clearCacheForExtensionPrincipal when application shutdown is already initiated. r=willdurand

Depends on D249652

Differential Revision: https://phabricator.services.mozilla.com/D250051
This commit is contained in:
Luca Greco
2025-05-20 12:44:12 +00:00
committed by luca.greco@alcacoop.it
parent 6f163fd7b0
commit f705ad367b

View File

@@ -443,6 +443,14 @@ function clearCacheForExtensionPrincipal(principal, clearAll = false) {
return Promise.reject(new Error("Unexpected non extension principal"));
}
if (Services.startup.shuttingDown) {
return Promise.reject(
new Error(
`clearCacheForExtensionPrincipal called after shutdown was initiated`
)
);
}
// TODO(Bug 1750053): replace the two specific flags with a "clear all caches one"
// (along with covering the other kind of cached data with tests).
const clearDataFlags = clearAll