Bug 1493680 - use the new getFront API and properly wait for the promise fullfilment r=gregtatum

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julien Wajsberg 2018-09-24 15:50:35 +00:00
parent 191e6758c8
commit fa3590f449

View File

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { PerfFront } = require("devtools/shared/fronts/perf");
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
class PerformancePanel {
@ -29,9 +28,10 @@ class PerformancePanel {
this.panelWin.gToolbox = this.toolbox;
this.panelWin.gTarget = this.target;
const rootForm = await this.target.root;
const perfFront = new PerfFront(this.target.client, rootForm);
const preferenceFront = this.target.client.mainRoot.getFront("preference");
const [perfFront, preferenceFront] = await Promise.all([
this.target.client.mainRoot.getFront("perf"),
this.target.client.mainRoot.getFront("preference")
]);
this.isReady = true;
this.emit("ready");