зеркало из https://github.com/mozilla/gecko-dev.git
Bug 941787 - Fix race between tab closure event and nested event loop popping in devtools browser actor. (r=panos)
This commit is contained in:
Родитель
5a92bd2828
Коммит
fbdf70e4d5
|
@ -481,6 +481,9 @@ function BrowserTabActor(aConnection, aBrowser, aTabBrowser)
|
|||
this._extraActors = {};
|
||||
|
||||
this._onWindowCreated = this.onWindowCreated.bind(this);
|
||||
|
||||
// Number of event loops nested.
|
||||
this._nestedEventLoopDepth = 0;
|
||||
}
|
||||
|
||||
// XXX (bug 710213): BrowserTabActor attach/detach/exit/disconnect is a
|
||||
|
@ -634,6 +637,9 @@ BrowserTabActor.prototype = {
|
|||
type: "tabDetached" });
|
||||
}
|
||||
|
||||
// Pop all nested event loops if we haven't already.
|
||||
while (this._nestedEventLoopDepth > 0)
|
||||
this.postNest();
|
||||
this._browser = null;
|
||||
this._tabbrowser = null;
|
||||
},
|
||||
|
@ -782,6 +788,7 @@ BrowserTabActor.prototype = {
|
|||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
windowUtils.suppressEventHandling(true);
|
||||
windowUtils.suspendTimeouts();
|
||||
this._nestedEventLoopDepth++;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -790,6 +797,8 @@ BrowserTabActor.prototype = {
|
|||
postNest: function BTA_postNest(aNestData) {
|
||||
if (!this.window) {
|
||||
// The tab is already closed.
|
||||
dbg_assert(this._nestedEventLoopDepth === 0,
|
||||
"window shouldn't be closed before all nested event loops have been popped");
|
||||
return;
|
||||
}
|
||||
let windowUtils = this.window
|
||||
|
@ -801,6 +810,7 @@ BrowserTabActor.prototype = {
|
|||
this._pendingNavigation.resume();
|
||||
this._pendingNavigation = null;
|
||||
}
|
||||
this._nestedEventLoopDepth--;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче