зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1461062: Follow-up: Fix rebase bustage. r=bustage CLOSED TREE
MozReview-Commit-ID: 2fjL5eCL2xP --HG-- extra : amend_source : 1fef859835028292ca163d840a61077bf05fcc06
This commit is contained in:
Родитель
668a980809
Коммит
166dab340b
|
@ -374,6 +374,8 @@ ScriptPreloader::Observe(nsISupports* subject, const char* topic, const char16_t
|
||||||
Result<nsCOMPtr<nsIFile>, nsresult>
|
Result<nsCOMPtr<nsIFile>, nsresult>
|
||||||
ScriptPreloader::GetCacheFile(const nsAString& suffix)
|
ScriptPreloader::GetCacheFile(const nsAString& suffix)
|
||||||
{
|
{
|
||||||
|
NS_ENSURE_TRUE(mProfD, Err(NS_ERROR_NOT_INITIALIZED));
|
||||||
|
|
||||||
nsCOMPtr<nsIFile> cacheFile;
|
nsCOMPtr<nsIFile> cacheFile;
|
||||||
MOZ_TRY(mProfD->Clone(getter_AddRefs(cacheFile)));
|
MOZ_TRY(mProfD->Clone(getter_AddRefs(cacheFile)));
|
||||||
|
|
||||||
|
|
|
@ -461,10 +461,21 @@ class AOMExtensionWrapper extends ExtensionWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
maybeSetID(uri, id) {
|
||||||
|
if (!this.id && uri instanceof Ci.nsIJARURI &&
|
||||||
|
uri.JARFile.QueryInterface(Ci.nsIFileURL)
|
||||||
|
.file.equals(this.file)) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setRestarting() {
|
setRestarting() {
|
||||||
if (this.state !== "restarting") {
|
if (this.state !== "restarting") {
|
||||||
this.startupPromise = new Promise(resolve => {
|
this.startupPromise = new Promise(resolve => {
|
||||||
this.resolveStartup = resolve;
|
this.resolveStartup = resolve;
|
||||||
|
}).then(async result => {
|
||||||
|
await this.addonPromise;
|
||||||
|
return result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.state = "restarting";
|
this.state = "restarting";
|
||||||
|
@ -497,7 +508,7 @@ class AOMExtensionWrapper extends ExtensionWrapper {
|
||||||
onEvent(kind, ...args) {
|
onEvent(kind, ...args) {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case "addon-manager-started":
|
case "addon-manager-started":
|
||||||
AddonManager.getAddonByID(this.id).then(addon => {
|
this.addonPromise = AddonManager.getAddonByID(this.id).then(addon => {
|
||||||
this.addon = addon;
|
this.addon = addon;
|
||||||
});
|
});
|
||||||
// FALLTHROUGH
|
// FALLTHROUGH
|
||||||
|
@ -509,6 +520,9 @@ class AOMExtensionWrapper extends ExtensionWrapper {
|
||||||
|
|
||||||
case "startup": {
|
case "startup": {
|
||||||
let [extension] = args;
|
let [extension] = args;
|
||||||
|
|
||||||
|
this.maybeSetID(extension.rootURI, extension.id);
|
||||||
|
|
||||||
if (extension.id === this.id) {
|
if (extension.id === this.id) {
|
||||||
this.attachExtension(extension);
|
this.attachExtension(extension);
|
||||||
this.state = "pending";
|
this.state = "pending";
|
||||||
|
|
Загрузка…
Ссылка в новой задаче