mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 773563 - Cleanup BTA_detach callers to avoid redundant state checks; r=robcee
This commit is contained in:
parent
3c4faf6777
commit
c5250fd127
@ -606,8 +606,7 @@ BrowserTabActor.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.attached) {
|
||||
this._detach();
|
||||
if (this._detach()) {
|
||||
this.conn.send({ from: this.actorID,
|
||||
type: "tabDetached" });
|
||||
}
|
||||
@ -675,10 +674,12 @@ BrowserTabActor.prototype = {
|
||||
|
||||
/**
|
||||
* Does the actual work of detaching from a tab.
|
||||
*
|
||||
* @returns false if the tab wasn't attached or true of detahing succeeds.
|
||||
*/
|
||||
_detach: function BTA_detach() {
|
||||
if (!this.attached) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this._progressListener) {
|
||||
@ -699,6 +700,7 @@ BrowserTabActor.prototype = {
|
||||
}
|
||||
|
||||
this._attached = false;
|
||||
return true;
|
||||
},
|
||||
|
||||
// Protocol Request Handlers
|
||||
@ -714,12 +716,10 @@ BrowserTabActor.prototype = {
|
||||
},
|
||||
|
||||
onDetach: function BTA_onDetach(aRequest) {
|
||||
if (!this.attached) {
|
||||
if (!this._detach()) {
|
||||
return { error: "wrongState" };
|
||||
}
|
||||
|
||||
this._detach();
|
||||
|
||||
return { type: "detached" };
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user