Bug 1508660 - make storage front and changes front async; r=ochameau

Depends on D13110

Differential Revision: https://phabricator.services.mozilla.com/D13336

--HG--
extra : moz-landing-system : lando
This commit is contained in:
yulia 2018-12-17 12:29:52 +00:00
Родитель 26f279b0fb
Коммит ff201583ca
3 изменённых файлов: 21 добавлений и 16 удалений

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

@ -44,23 +44,28 @@ class AccessibilityStartup {
// We must call a method on an accessibility front here (such as getWalker), in
// oreder to be able to check actor's backward compatibility via actorHasMethod.
// See targe.js@getActorDescription for more information.
this._walker = await this._accessibility.getWalker();
try {
this._walker = await this._accessibility.getWalker();
this._supports = {};
// Only works with FF61+ targets
this._supports.enableDisable =
await this.target.actorHasMethod("accessibility", "enable");
this._supports = {};
// Only works with FF61+ targets
this._supports.enableDisable =
await this.target.actorHasMethod("accessibility", "enable");
if (this._supports.enableDisable) {
([ this._supports.relations, this._supports.snapshot ] = await Promise.all([
this.target.actorHasMethod("accessible", "getRelations"),
this.target.actorHasMethod("accessible", "snapshot"),
]));
if (this._supports.enableDisable) {
([ this._supports.relations, this._supports.snapshot ] = await Promise.all([
this.target.actorHasMethod("accessible", "getRelations"),
this.target.actorHasMethod("accessible", "snapshot"),
]));
await this._accessibility.bootstrap();
await this._accessibility.bootstrap();
}
return true;
} catch (e) {
// toolbox may be destroyed during this step.
return false;
}
return true;
}
/**

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

@ -54,7 +54,7 @@ class ChangesView {
}
this.changesFrontPromise = new Promise(async resolve => {
const target = this.inspector.target;
const front = target.getFront("changes");
const front = await target.getFront("changes");
this.onChangesFront(front);
resolve(front);
});

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

@ -33,9 +33,9 @@ class StoragePanel {
/**
* open is effectively an asynchronous constructor
*/
open() {
async open() {
this.target.on("close", this.destroy);
this._front = this.target.getFront("storage");
this._front = await this.target.getFront("storage");
this.UI = new StorageUI(this._front, this._target,
this._panelWin, this._toolbox);