Bug 1167426 - The `_connected` property in PerformanceActorsConnection is not necessary, r=jsantell, a=sledru
authorVictor Porof <vporof@mozilla.com>
Fri, 22 May 2015 16:29:20 -0400
changeset 274872 3ef44497abecd4d008493b67294b2f37086a000f
parent 274871 1606aab5216f89bbc29f96da0869d9d93541b1da
child 274873 f0b5a5abc1304c8c5ee13952f27de6b2ca8ad021
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjsantell, sledru
bugs1167426
milestone40.0a2
Bug 1167426 - The `_connected` property in PerformanceActorsConnection is not necessary, r=jsantell, a=sledru
browser/devtools/performance/modules/logic/front.js
--- a/browser/devtools/performance/modules/logic/front.js
+++ b/browser/devtools/performance/modules/logic/front.js
@@ -111,38 +111,39 @@ PerformanceActorsConnection.prototype = 
 
     // Sets `this._profiler`, `this._timeline` and `this._memory`.
     // Only initialize the timeline and memory fronts if the respective actors
     // are available. Older Gecko versions don't have existing implementations,
     // in which case all the methods we need can be easily mocked.
     yield this._connectActors();
     yield this._registerListeners();
 
-    this._connected = true;
-
     this._connecting.resolve();
     Services.obs.notifyObservers(null, "performance-actors-connection-opened", null);
   }),
 
   /**
    * Destroys this connection.
    */
   destroy: Task.async(function*() {
-    if (this._connecting && !this._connected) {
+    if (this._connecting) {
       yield this._connecting.promise;
-    } else if (!this._connected) {
+    } else {
       return;
     }
 
     yield this._unregisterListeners();
     yield this._disconnectActors();
 
-    this._memory = this._timeline = this._profiler = this._target = this._client = null;
-    this._connected = false;
     this._connecting = null;
+    this._profiler = null;
+    this._timeline = null;
+    this._memory = null;
+    this._target = null;
+    this._client = null;
   }),
 
   /**
    * Initializes fronts and connects to the underlying actors using the facades
    * found in ./actors.js.
    */
   _connectActors: Task.async(function*() {
     this._profiler = new Actors.ProfilerFront(this._target);