Bug 1266832 - add dummy telemetry object to Services shim; r=gregtatum
authorTom Tromey <tom@tromey.com>
Wed, 20 Jul 2016 13:53:50 -0600
changeset 306240 b92567e80d1e3b4b18cd1bb7534735417a27d3d8
parent 306239 42532fefe29324b9d002d6bf1cee38c3e55e2cc1
child 306241 9299e5e388d4846246bca9af94ac391d458b7008
push id30774
push userttromey@mozilla.com
push dateFri, 22 Jul 2016 16:46:38 +0000
treeherderautoland@b92567e80d1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregtatum
bugs1266832
milestone50.0a1
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
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