Bug 1266832 - add dummy telemetry object to Services shim; r?gregtatum draft
authorTom Tromey <tom@tromey.com>
Wed, 20 Jul 2016 13:53:50 -0600
changeset 390226 ec552b2da67dbd756c08a58be864b5b3f942fb10
parent 390225 c050984325e379286c1456a261b0cdc92dab89c1
child 525952 6119c329e2369cf789ad966c4edbc59e6f7ecec1
push id23620
push userbmo:ttromey@mozilla.com
push dateWed, 20 Jul 2016 20:14:19 +0000
reviewersgregtatum
bugs1266832
milestone50.0a1
Bug 1266832 - add dummy telemetry object to Services shim; r?gregtatum MozReview-Commit-ID: Cg6ciWVNbEx
devtools/client/shared/shim/Services.js
--- a/devtools/client/shared/shim/Services.js
+++ b/devtools/client/shared/shim/Services.js
@@ -496,16 +496,34 @@ const Services = {
     },
 
     // This is only used by telemetry, which is disabled for the
     // content case.  So, being totally wrong is ok.
     get is64Bit() {
       return true;
     },
   },
+
+  /**
+   * A no-op implementation of Services.telemetry.  This supports just
+   * the subset of Services.telemetry that is used by devtools.
+   */
+  telemetry: {
+    getHistogramById: function (name) {
+      return {
+        add: () => {}
+      };
+    },
+
+    getKeyedHistogramById: function (name) {
+      return {
+        add: () => {}
+      };
+    },
+  },
 };
 
 /**
  * Create a new preference.  This is used during startup (see
  * devtools/client/preferences/devtools.js) to install the
  * default preferences.
  *
  * @param {String} name the name of the preference