Bug 960669 - Close Browser Toolbox on browser shutdown. r=past

This commit is contained in:
J. Ryan Stinnett 2014-01-24 11:29:33 -06:00
Родитель a4369b7897
Коммит 5f01b185a2
1 изменённых файлов: 12 добавлений и 2 удалений

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

@ -32,6 +32,8 @@ this.BrowserToolboxProcess = function BrowserToolboxProcess(aOnClose, aOnRun) {
this._runCallback = aOnRun;
this._telemetry = new Telemetry();
this.close = this.close.bind(this);
Services.obs.addObserver(this.close, "quit-application", false);
this._initServer();
this._initProfile();
this._create();
@ -154,19 +156,27 @@ BrowserToolboxProcess.prototype = {
},
/**
* Closes the remote debugger, removing the profile and killing the process.
* Closes the remote debugging server and kills the toolbox process.
*/
close: function() {
if (this.closed) {
return;
}
dumpn("Cleaning up the chrome debugging process.");
Services.obs.removeObserver(this.close, "quit-application");
if (this._dbgProcess.isRunning) {
this._dbgProcess.kill();
}
this._telemetry.toolClosed("jsbrowserdebugger");
this.debuggerServer.destroy();
if (this.debuggerServer) {
this.debuggerServer.destroy();
}
dumpn("Chrome toolbox is now closed...");
this.closed = true;
if (typeof this._closeCallback == "function") {
this._closeCallback.call({}, this);
}