Bug 1457127 - Do not reflect histograms that are not for the current product. r?chutten,janerik draft
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Wed, 16 May 2018 13:09:33 +0200
changeset 797015 8cb736b6f03d368bb0d413e524b362eef72f1792
parent 797014 1c0952d5366445713f95c490b787967cebc591f1
child 797016 be265eaa3de0d16c45ceca65b33c74dd21032a2f
push id110396
push userbmo:alessio.placitelli@gmail.com
push dateFri, 18 May 2018 15:30:15 +0000
reviewerschutten, janerik
bugs1457127
milestone62.0a1
Bug 1457127 - Do not reflect histograms that are not for the current product. r?chutten,janerik This ensures that histograms that are not allowed on a product will not be present in a snapshot. This is mainly to work around the fact that legacy flag histograms are always reported, even if they are not set. MozReview-Commit-ID: EyR6KhjPC4o
toolkit/components/telemetry/TelemetryHistogram.cpp
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -752,16 +752,21 @@ internal_ShouldReflectHistogram(Histogra
   // This has historical reasons, changing this will require downstream changes.
   // The cheaper path here is to just deprecate flag histograms in favor
   // of scalars.
   uint32_t type = gHistogramInfos[id].histogramType;
   if (internal_IsEmpty(h) && type != nsITelemetry::HISTOGRAM_FLAG) {
     return false;
   }
 
+  // Don't reflect the histogram if it's not allowed in this product.
+  if (!CanRecordProduct(gHistogramInfos[id].products)) {
+    return false;
+  }
+
   return true;
 }
 
 /**
  * Helper function to get a snapshot of the histograms.
  *
  * @param {aLock} the lock proof.
  * @param {aDataset} the dataset for which the snapshot is being requested.