Skip to content

Commit

Permalink
Bug 1262386 - Move Scheduler shutdown() next to init(). r=dexter
Browse files Browse the repository at this point in the history
  • Loading branch information
georgf committed Apr 29, 2016
1 parent daea52c commit e44cdea
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions toolkit/components/telemetry/TelemetrySession.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,30 @@ var TelemetryScheduler = {
idleService.addIdleObserver(this, IDLE_TIMEOUT_SECONDS);
},

/**
* Stops the scheduler.
*/
shutdown: function() {
if (this._shuttingDown) {
if (this._log) {
this._log.error("shutdown - Already shut down");
} else {
Cu.reportError("TelemetryScheduler.shutdown - Already shut down");
}
return;
}

this._log.trace("shutdown");
if (this._schedulerTimer) {
Policy.clearSchedulerTickTimeout(this._schedulerTimer);
this._schedulerTimer = null;
}

idleService.removeIdleObserver(this, IDLE_TIMEOUT_SECONDS);

this._shuttingDown = true;
},

_clearTimeout: function() {
if (this._schedulerTimer) {
Policy.clearSchedulerTickTimeout(this._schedulerTimer);
Expand Down Expand Up @@ -517,30 +541,6 @@ var TelemetryScheduler = {

this._rescheduleTimeout();
},

/**
* Stops the scheduler.
*/
shutdown: function() {
if (this._shuttingDown) {
if (this._log) {
this._log.error("shutdown - Already shut down");
} else {
Cu.reportError("TelemetryScheduler.shutdown - Already shut down");
}
return;
}

this._log.trace("shutdown");
if (this._schedulerTimer) {
Policy.clearSchedulerTickTimeout(this._schedulerTimer);
this._schedulerTimer = null;
}

idleService.removeIdleObserver(this, IDLE_TIMEOUT_SECONDS);

this._shuttingDown = true;
}
};

this.EXPORTED_SYMBOLS = ["TelemetrySession"];
Expand Down

0 comments on commit e44cdea

Please sign in to comment.