Bug 1167961 - Task is incorrectly used in compatibility.js, r=jsantell, a=sledru
authorVictor Porof <vporof@mozilla.com>
Sun, 24 May 2015 12:12:20 -0400
changeset 274879 1b5736de0e4f228dcf49b7ee7c85b6ba31d4da38
parent 274878 0cda21618fea64cfc731978618cb3cd2eaf98e9c
child 274880 76a2777f32682837fdaa6ef5e2c8e68905e3f8ee
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
bugs1167961
milestone40.0a2
Bug 1167961 - Task is incorrectly used in compatibility.js, r=jsantell, a=sledru
browser/devtools/performance/modules/logic/compatibility.js
--- a/browser/devtools/performance/modules/logic/compatibility.js
+++ b/browser/devtools/performance/modules/logic/compatibility.js
@@ -1,15 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 "use strict";
 
-const { Task } = require("resource://gre/modules/Task.jsm");
-
 loader.lazyRequireGetter(this, "promise");
 loader.lazyRequireGetter(this, "EventEmitter",
   "devtools/toolkit/event-emitter");
 
 /**
  * A dummy front decorated with the provided methods.
  *
  * @param array blueprint
@@ -81,17 +79,17 @@ function memoryActorSupported (target) {
   }
 
   // We need to test that both the root actor has `memoryActorAllocations`,
   // which is in Gecko 38+, and also that the target has a memory actor. There
   // are scenarios, like addon debugging, where memoryActorAllocations is available,
   // but no memory actor (like addon debugging in Gecko 38+)
   return !!target.getTrait("memoryActorAllocations") && target.hasActor("memory");
 }
-exports.memoryActorSupported = Task.async(memoryActorSupported);
+exports.memoryActorSupported = memoryActorSupported;
 
 /**
  * Takes a TabTarget, and checks existence of a TimelineActor on
  * the server, or if TEST_MOCK_TIMELINE_ACTOR is to be used.
  *
  * @param {TabTarget} target
  * @return {Boolean}
  */
@@ -99,17 +97,17 @@ function timelineActorSupported(target) 
   // This `target` property is used only in tests to test
   // instances where the timeline actor is not available.
   if (target.TEST_MOCK_TIMELINE_ACTOR) {
     return false;
   }
 
   return target.hasActor("timeline");
 }
-exports.timelineActorSupported = Task.async(timelineActorSupported);
+exports.timelineActorSupported = timelineActorSupported;
 
 /**
  * Returns a promise resolving to the location of the profiler actor
  * within this context.
  *
  * @param {TabTarget} target
  * @return {Promise<ProfilerActor>}
  */
@@ -126,17 +124,17 @@ function getProfiler (target) {
     deferred.resolve(target.root.profilerActor);
   }
   // Otherwise, call `listTabs`.
   else {
     target.client.listTabs(({ profilerActor }) => deferred.resolve(profilerActor));
   }
   return deferred.promise;
 }
-exports.getProfiler = Task.async(getProfiler);
+exports.getProfiler = getProfiler;
 
 /**
  * Makes a request to an actor that does not have the modern `Front`
  * interface.
  */
 function legacyRequest (target, actor, method, args) {
   let deferred = promise.defer();
   let data = args[0] || {};