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:
Kris Maglione 2018-05-16 19:07:01 -07:00
Родитель 668a980809
Коммит 166dab340b
2 изменённых файлов: 17 добавлений и 1 удалений

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

@ -374,6 +374,8 @@ ScriptPreloader::Observe(nsISupports* subject, const char* topic, const char16_t
Result<nsCOMPtr<nsIFile>, nsresult>
ScriptPreloader::GetCacheFile(const nsAString& suffix)
{
NS_ENSURE_TRUE(mProfD, Err(NS_ERROR_NOT_INITIALIZED));
nsCOMPtr<nsIFile> 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() {
if (this.state !== "restarting") {
this.startupPromise = new Promise(resolve => {
this.resolveStartup = resolve;
}).then(async result => {
await this.addonPromise;
return result;
});
}
this.state = "restarting";
@ -497,7 +508,7 @@ class AOMExtensionWrapper extends ExtensionWrapper {
onEvent(kind, ...args) {
switch (kind) {
case "addon-manager-started":
AddonManager.getAddonByID(this.id).then(addon => {
this.addonPromise = AddonManager.getAddonByID(this.id).then(addon => {
this.addon = addon;
});
// FALLTHROUGH
@ -509,6 +520,9 @@ class AOMExtensionWrapper extends ExtensionWrapper {
case "startup": {
let [extension] = args;
this.maybeSetID(extension.rootURI, extension.id);
if (extension.id === this.id) {
this.attachExtension(extension);
this.state = "pending";