Bug 816983 - Closing Browser Debugger via the Window Close button no longer kills the Browser Debugger Process, r=rcampbell

This commit is contained in:
Victor Porof 2012-12-04 15:48:39 +02:00
parent a30c95948b
commit dbe6e6a5d8
4 changed files with 21 additions and 20 deletions

View File

@ -151,10 +151,12 @@ let DebuggerController = {
}
let client;
// Remote debugging gets the debuggee from a RemoteTarget object.
if (this._target && this._target.isRemote) {
client = this.client = this._target.client;
window._isRemoteDebugger = true;
client = this.client = this._target.client;
this._target.on("close", this._onTabDetached);
this._target.on("navigate", this._onTabNavigated);
@ -167,13 +169,13 @@ let DebuggerController = {
return;
}
// Content debugging can connect directly to the page.
// Content or chrome debugging can connect directly to the debuggee.
// TODO: convert this to use a TabTarget.
let transport = window._isChromeDebugger
? debuggerSocketConnect(Prefs.remoteHost, Prefs.remotePort)
: DebuggerServer.connectPipe();
client = this.client = new DebuggerClient(transport);
client = this.client = new DebuggerClient(transport);
client.addListener("tabNavigated", this._onTabNavigated);
client.addListener("tabDetached", this._onTabDetached);
@ -201,11 +203,12 @@ let DebuggerController = {
this.client.removeListener("tabNavigated", this._onTabNavigated);
this.client.removeListener("tabDetached", this._onTabDetached);
if (!this._target.isRemote) {
// When remote debugging, the connection is closed by the RemoteTarget.
if (!window._isRemoteDebugger) {
this.client.close();
this.client = null;
}
this.client = null;
this.tabClient = null;
this.activeThread = null;
},
@ -235,8 +238,7 @@ let DebuggerController = {
* @param object aTabGrip
* The remote protocol grip of the tab.
*/
_startDebuggingTab: function DC__startDebuggingTab
(aClient, aTabGrip, aCallback=function(){}) {
_startDebuggingTab: function DC__startDebuggingTab(aClient, aTabGrip, aCallback) {
if (!aClient) {
Cu.reportError("No client found!");
return;
@ -262,7 +264,9 @@ let DebuggerController = {
this.SourceScripts.connect();
aThreadClient.resume();
aCallback();
if (aCallback) {
aCallback();
}
}.bind(this));
}.bind(this));
},
@ -275,8 +279,7 @@ let DebuggerController = {
* @param object aChromeDebugger
* The remote protocol grip of the chrome debugger.
*/
_startChromeDebugging: function DC__startChromeDebugging
(aClient, aChromeDebugger, aCallback=function(){}) {
_startChromeDebugging: function DC__startChromeDebugging(aClient, aChromeDebugger, aCallback) {
if (!aClient) {
Cu.reportError("No client found!");
return;
@ -295,7 +298,9 @@ let DebuggerController = {
this.SourceScripts.connect();
aThreadClient.resume();
aCallback();
if (aCallback) {
aCallback();
}
}.bind(this));
},

View File

@ -51,8 +51,7 @@ create({ constructor: StackFramesView, proto: MenuContainer.prototype }, {
* @param number aDepth
* The frame depth specified by the debugger.
*/
addFrame:
function DVSF_addFrame(aFrameName, aFrameDetails, aDepth) {
addFrame: function DVSF_addFrame(aFrameName, aFrameDetails, aDepth) {
// Stackframes are UI elements which benefit from visible panes.
DebuggerView.showPanesSoon();

View File

@ -627,7 +627,7 @@ FilterView.prototype = {
* @param object aView
*/
set target(aView) {
var placeholder = "";
let placeholder = "";
switch (aView) {
case DebuggerView.ChromeGlobals:
placeholder = L10N.getFormatStr("emptyChromeGlobalsFilterText", [this._fileSearchKey]);

View File

@ -900,8 +900,7 @@ MenuContainer.prototype = {
* @return MenuItem
* The matched item, or null if nothing is found.
*/
getItemForElement:
function DVMC_getItemForElement(aElement) {
getItemForElement: function DVMC_getItemForElement(aElement) {
while (aElement) {
let item = this._itemsByElement.get(aElement);
if (item) {
@ -1035,8 +1034,7 @@ MenuContainer.prototype = {
* @return MenuItem
* The item associated with the displayed element, null if rejected.
*/
_appendItem:
function DVMC__appendItem(aItem, aOptions = {}) {
_appendItem: function DVMC__appendItem(aItem, aOptions = {}) {
if (!aOptions.relaxed && !this.isEligible(aItem)) {
return null;
}
@ -1058,8 +1056,7 @@ MenuContainer.prototype = {
* @return MenuItem
* The item associated with the displayed element, null if rejected.
*/
_insertItemAt:
function DVMC__insertItemAt(aIndex, aItem, aOptions) {
_insertItemAt: function DVMC__insertItemAt(aIndex, aItem, aOptions) {
if (!aOptions.relaxed && !this.isEligible(aItem)) {
return null;
}