Bug 1567860 - Make inspector panel's destroy synchronous. r=rcaliman

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2019-07-25 11:54:22 +00:00
Родитель 91c0c3d8b5
Коммит 40f0d43088
1 изменённых файлов: 5 добавлений и 8 удалений

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

@ -322,7 +322,7 @@ Inspector.prototype = {
* while still initializing (and making protocol requests).
*/
_handleRejectionIfNotDestroyed: function(e) {
if (!this._panelDestroyer) {
if (!this._destroyed) {
console.error(e);
}
},
@ -1378,7 +1378,7 @@ Inspector.prototype = {
* reload
*/
set selectionCssSelector(cssSelector = null) {
if (this._panelDestroyer) {
if (this._destroyed) {
return;
}
@ -1563,9 +1563,10 @@ Inspector.prototype = {
* Destroy the inspector.
*/
destroy: function() {
if (this._panelDestroyer) {
return this._panelDestroyer;
if (this._destroyed) {
return;
}
this._destroyed = true;
this._target.threadFront.off("paused", this.handleThreadPaused);
this._target.threadFront.off("resumed", this.handleThreadResumed);
@ -1641,10 +1642,6 @@ Inspector.prototype = {
this.sidebar = null;
this.store = null;
this.telemetry = null;
this._panelDestroyer = Promise.resolve();
return this._panelDestroyer;
},
_initMarkup: function() {