Backed out changeset 5e9ed1f7aebe (bug 1139460)
authorWes Kocher <wkocher@mozilla.com>
Fri, 27 Mar 2015 15:31:18 -0700
changeset 265073 b263e867106537f3093c2ccafa8894332ef3265e
parent 265072 832a874a7ccc434b7013553e191920f9fed078c9
child 265074 7cac0fa17c0dd746be462c2d0d3b0707f5108f00
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1139460
milestone39.0a1
backs out5e9ed1f7aebe5a49f84c2e5d82c2da85de16bcb7
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 5e9ed1f7aebe (bug 1139460)
browser/experiments/Experiments.jsm
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -134,16 +134,38 @@ function configureLogging() {
     } else {
       gLogger.removeAppender(gLogAppenderDump);
       gLogAppenderDump = null;
     }
     gLogDumping = logDumping;
   }
 }
 
+// Takes an array of promises and returns a promise that is resolved once all of
+// them are rejected or resolved.
+function allResolvedOrRejected(promises) {
+  if (!promises.length) {
+    return Promise.resolve([]);
+  }
+
+  let countdown = promises.length;
+  let deferred = Promise.defer();
+
+  for (let p of promises) {
+    let helper = () => {
+      if (--countdown == 0) {
+        deferred.resolve();
+      }
+    };
+    Promise.resolve(p).then(helper, helper);
+  }
+
+  return deferred.promise;
+}
+
 // Loads a JSON file using OS.file. file is a string representing the path
 // of the file to be read, options contains additional options to pass to
 // OS.File.read.
 // Returns a Promise resolved with the json payload or rejected with
 // OS.File.Error or JSON.parse() errors.
 function loadJSONAsync(file, options) {
   return Task.spawn(function() {
     let rawData = yield OS.File.read(file, options);