mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Bug 1446821: Add shutdown blocker for async extension uninstall tasks. r=mixedpuppy
MozReview-Commit-ID: AMHkqviDMoV --HG-- extra : rebase_source : 2986a4e1e1c9deb3bc4ae38ef6fd703f273db61b extra : amend_source : 5bb6ada7ff2e46ae5005ea8556dfd5f102c74e66
This commit is contained in:
parent
7780b45b3a
commit
883c7e5fce
@ -82,14 +82,16 @@ this.chrome_settings_overrides = class extends ExtensionAPI {
|
||||
}
|
||||
|
||||
static removeSearchSettings(id) {
|
||||
this.processDefaultSearchSetting("removeSetting", id);
|
||||
this.removeEngine(id);
|
||||
return Promise.all([
|
||||
this.processDefaultSearchSetting("removeSetting", id),
|
||||
this.removeEngine(id),
|
||||
]);
|
||||
}
|
||||
|
||||
static onUninstall(id) {
|
||||
// Note: We do not have to deal with homepage here as it is managed by
|
||||
// the ExtensionPreferencesManager.
|
||||
this.removeSearchSettings(id);
|
||||
return this.removeSearchSettings(id);
|
||||
}
|
||||
|
||||
static onUpdate(id, manifest) {
|
||||
|
@ -1089,7 +1089,9 @@ const shutdownPromises = new Map();
|
||||
class BootstrapScope {
|
||||
install(data, reason) {}
|
||||
uninstall(data, reason) {
|
||||
Management.emit("uninstall", {id: data.id});
|
||||
AsyncShutdown.profileChangeTeardown.addBlocker(
|
||||
`Uninstalling add-on: ${data.id}`,
|
||||
Management.emit("uninstall", {id: data.id}));
|
||||
}
|
||||
|
||||
update(data, reason) {
|
||||
|
@ -102,7 +102,7 @@ let apiManager = new class extends SchemaAPIManager {
|
||||
let modules = this.eventModules.get("uninstall");
|
||||
return Promise.all(Array.from(modules).map(async apiName => {
|
||||
let module = await this.asyncLoadModule(apiName);
|
||||
module.onUninstall(id);
|
||||
return module.onUninstall(id);
|
||||
}));
|
||||
});
|
||||
/* eslint-enable mozilla/balanced-listeners */
|
||||
|
Loading…
Reference in New Issue
Block a user