зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1380267: Fix shutdown blocker corner cases. r=aswan
MozReview-Commit-ID: 8Dgvnm96hgT --HG-- extra : rebase_source : c5cd4f096bf85af2ff098182037fff36a479bada
This commit is contained in:
Родитель
aea79443fa
Коммит
8d6640a18f
|
@ -982,7 +982,7 @@ this.Extension = class extends ExtensionData {
|
|||
resolve();
|
||||
}
|
||||
};
|
||||
ppmm.addMessageListener(msg + "Complete", listener);
|
||||
ppmm.addMessageListener(msg + "Complete", listener, true);
|
||||
Services.obs.addObserver(observer, "message-manager-close");
|
||||
Services.obs.addObserver(observer, "message-manager-disconnect");
|
||||
|
||||
|
@ -1198,6 +1198,14 @@ this.Extension = class extends ExtensionData {
|
|||
`Extension Shutdown: ${this.id} (${this.manifest && this.name})`,
|
||||
promise.catch(() => {}));
|
||||
|
||||
// If we already have a shutdown promise for this extension, wait
|
||||
// for it to complete before replacing it with a new one. This can
|
||||
// sometimes happen during tests with rapid startup/shutdown cycles
|
||||
// of multiple versions.
|
||||
if (shutdownPromises.has(this.id)) {
|
||||
await shutdownPromises.get(this.id);
|
||||
}
|
||||
|
||||
let cleanup = () => {
|
||||
shutdownPromises.delete(this.id);
|
||||
};
|
||||
|
|
|
@ -343,12 +343,14 @@ ExtensionManager = {
|
|||
case "Extension:Shutdown": {
|
||||
let policy = WebExtensionPolicy.getByID(data.id);
|
||||
|
||||
if (extensions.has(policy)) {
|
||||
extensions.get(policy).shutdown();
|
||||
}
|
||||
if (policy) {
|
||||
if (extensions.has(policy)) {
|
||||
extensions.get(policy).shutdown();
|
||||
}
|
||||
|
||||
if (isContentProcess) {
|
||||
policy.active = false;
|
||||
if (isContentProcess) {
|
||||
policy.active = false;
|
||||
}
|
||||
}
|
||||
Services.cpmm.sendAsyncMessage("Extension:ShutdownComplete");
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче