Bug 1399985. Add build ID and update channel to WebCompatReporter details param. r=Gijs
☠☠ backed out by 6225ece1cd5c ☠ ☠
authorMike Taylor <miket@mozilla.com>
Mon, 16 Apr 2018 18:20:27 -0500
changeset 468340 42f5c08a4d86967ccd3df66c3fc3c30cc52c6497
parent 468339 427e3dce92c2eec8fa9a167fef3f2a726b4010a6
child 468341 40c5d3600d35e2d3df7a4f2ab75c64688ee7dc6d
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1399985
milestone61.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 1399985. Add build ID and update channel to WebCompatReporter details param. r=Gijs MozReview-Commit-ID: HHok94kGFfe
browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
--- a/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
+++ b/browser/extensions/webcompat-reporter/content/WebCompatReporter.jsm
@@ -11,25 +11,27 @@ ChromeUtils.import("resource://gre/modul
 ChromeUtils.defineModuleGetter(this, "PageActions",
   "resource:///modules/PageActions.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "wcStrings", function() {
   return Services.strings.createBundle(
     "chrome://webcompat-reporter/locale/webcompat.properties");
 });
 
-// Gather values for prefs we want to appear in reports.
-let prefs = {};
-XPCOMUtils.defineLazyPreferenceGetter(prefs, "gfx.webrender.all", "gfx.webrender.all", false);
-XPCOMUtils.defineLazyPreferenceGetter(prefs, "gfx.webrender.blob-images", "gfx.webrender.blob-images", true);
-XPCOMUtils.defineLazyPreferenceGetter(prefs, "gfx.webrender.enabled", "gfx.webrender.enabled", false);
-XPCOMUtils.defineLazyPreferenceGetter(prefs, "image.mem.shared", "image.mem.shared", true);
+// Gather values for interesting details we want to appear in reports.
+let details = {};
+XPCOMUtils.defineLazyPreferenceGetter(details, "gfx.webrender.all", "gfx.webrender.all", false);
+XPCOMUtils.defineLazyPreferenceGetter(details, "gfx.webrender.blob-images", "gfx.webrender.blob-images", 1);
+XPCOMUtils.defineLazyPreferenceGetter(details, "gfx.webrender.enabled", "gfx.webrender.enabled", false);
+XPCOMUtils.defineLazyPreferenceGetter(details, "image.mem.shared", "image.mem.shared", 2);
+details.buildID = Services.appinfo.appBuildID;
+details.channel = AppConstants.MOZ_UPDATE_CHANNEL;
 
 if (AppConstants.platform == "linux") {
-  XPCOMUtils.defineLazyPreferenceGetter(prefs, "layers.acceleration.force-enabled", "layers.acceleration.force-enabled", false);
+  XPCOMUtils.defineLazyPreferenceGetter(details, "layers.acceleration.force-enabled", "layers.acceleration.force-enabled", false);
 }
 
 let WebCompatReporter = {
   get endpoint() {
     return Services.urlFormatter.formatURLPref(
       "extensions.webcompat-reporter.newIssueEndpoint");
   },
 
@@ -86,19 +88,19 @@ let WebCompatReporter = {
     const SCREENSHOT_MESSAGE = "WebCompat:SendScreenshot";
     const FRAMESCRIPT = "chrome://webcompat-reporter/content/wc-frame.js";
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     const WEBCOMPAT_ORIGIN = new win.URL(WebCompatReporter.endpoint).origin;
 
     let params = new URLSearchParams();
     params.append("url", `${tabData.url}`);
     params.append("src", "desktop-reporter");
-    params.append("details", JSON.stringify(prefs));
+    params.append("details", JSON.stringify(details));
 
-    if (prefs["gfx.webrender.all"] || prefs["gfx.webrender.enabled"]) {
+    if (details["gfx.webrender.all"] || details["gfx.webrender.enabled"]) {
       params.append("label", "type-webrender-enabled");
     }
 
     let tab = gBrowser.loadOneTab(
       `${WebCompatReporter.endpoint}?${params}`,
       {inBackground: false, triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal()});
 
     // If we successfully got a screenshot blob, add a listener to know when