Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / devtools / client / storage / panel.js
blob79b579b2bc079278e8e85d5d28604932c890fce3
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 "use strict";
7 const EventEmitter = require("resource://devtools/shared/event-emitter.js");
9 loader.lazyRequireGetter(
10 this,
11 "StorageUI",
12 "resource://devtools/client/storage/ui.js",
13 true
16 class StoragePanel {
17 constructor(panelWin, toolbox, commands) {
18 EventEmitter.decorate(this);
20 this._toolbox = toolbox;
21 this._commands = commands;
22 this._panelWin = panelWin;
25 get panelWindow() {
26 return this._panelWin;
29 /**
30 * open is effectively an asynchronous constructor
32 async open() {
33 this.UI = new StorageUI(this._panelWin, this._toolbox, this._commands);
35 await this.UI.init();
37 return this;
40 /**
41 * Destroy the storage inspector.
43 destroy() {
44 if (this._destroyed) {
45 return;
47 this._destroyed = true;
49 this.UI.destroy();
50 this.UI = null;
52 this._toolbox = null;
53 this._panelWin = null;
57 exports.StoragePanel = StoragePanel;