Bug 1686229 - Part3. Display a module's loading status on about:support. r=Gijs,fluent-reviewers
authorToshihito Kikuchi <tkikuchi@mozilla.com>
Fri, 22 Jan 2021 21:40:46 +0000
changeset 564374 fe3a3c7c50323b2c52f0d8fe6cf00603cfb645c9
parent 564373 9dc6d54ed4eb44066e9b0783d995aaae5500938e
child 564375 ae04412110021c5bfe5d89ca075528aaddf53b2a
push id38135
push userncsoregi@mozilla.com
push dateSat, 23 Jan 2021 10:00:21 +0000
treeherdermozilla-central@ae0441211002 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, fluent-reviewers
bugs1686229
milestone86.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 1686229 - Part3. Display a module's loading status on about:support. r=Gijs,fluent-reviewers This patch displays the new telemetry field "loadStatus", which was introduced by the earlier patch, on about:support. With this information, a user can see each of injected modules was really loaded or blocked by our DLL blocklist. Differential Revision: https://phabricator.services.mozilla.com/D102409
mozglue/dllservices/ModuleLoadInfo.h
toolkit/content/aboutSupport.js
toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
--- a/mozglue/dllservices/ModuleLoadInfo.h
+++ b/mozglue/dllservices/ModuleLoadInfo.h
@@ -9,16 +9,19 @@
 
 #include "mozilla/NativeNt.h"
 #include "mozilla/Vector.h"
 #include "mozilla/Unused.h"
 
 namespace mozilla {
 
 struct ModuleLoadInfo final {
+  // If you add a new value or change the meaning of the values, please
+  // update createLoadStatusElement in aboutSupport.js accordingly, which
+  // defines text labels of these enum values displayed on about:support.
   enum class Status : uint32_t {
     Loaded = 0,
     Blocked,
     Redirected,
   };
 
   // We do not provide these methods inside Gecko proper.
 #if !defined(MOZILLA_INTERNAL_API)
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -1184,16 +1184,26 @@ var snapshotFormatters = {
     }
 
     const createElementWithLabel = (tag, label) =>
       label
         ? $.new(tag, label)
         : $.new(tag, "", "", {
             "data-l10n-id": "support-third-party-modules-no-value",
           });
+    const createLoadStatusElement = (tag, status) => {
+      const labelLoadStatus = [
+        "support-third-party-modules-status-loaded",
+        "support-third-party-modules-status-blocked",
+        "support-third-party-modules-status-redirected",
+      ];
+      return status >= 0 && status < labelLoadStatus.length
+        ? $.new(tag, "", "", { "data-l10n-id": labelLoadStatus[status] })
+        : $.new(tag, status);
+    };
 
     const iconUp = "chrome://global/skin/icons/arrow-up-12.svg";
     const iconDown = "chrome://global/skin/icons/arrow-dropdown-12.svg";
     const iconFolder = "chrome://global/skin/icons/findFile.svg";
     const iconUnsigned =
       "chrome://global/skin/icons/connection-mixed-active-loaded.svg";
     const outerTHead = $("third-party-modules-thead");
     const outerTBody = $("third-party-modules-tbody");
@@ -1228,16 +1238,17 @@ var snapshotFormatters = {
           $.new("tr", [
             $.new("td", event.processIdAndType),
             createElementWithLabel("td", event.threadName),
             $.new("td", event.baseAddress),
             $.new("td", event.processUptimeMS),
             // loadDurationMS can be empty (not zero) when a module is loaded
             // very early in the process.  processUptimeMS always has a value.
             createElementWithLabel("td", event.loadDurationMS),
+            createLoadStatusElement("td", event.loadStatus),
           ])
         );
       }
 
       const detailRow = $.new(
         "tr",
         [
           $.new(
@@ -1255,16 +1266,19 @@ var snapshotFormatters = {
                     "data-l10n-id": "support-third-party-modules-base",
                   }),
                   $.new("th", "", "", {
                     "data-l10n-id": "support-third-party-modules-uptime",
                   }),
                   $.new("th", "", "", {
                     "data-l10n-id": "support-third-party-modules-duration",
                   }),
+                  $.new("th", "", "", {
+                    "data-l10n-id": "support-third-party-modules-status",
+                  }),
                 ]),
                 innerTBody,
               ]),
             ],
             "",
             { colspan: outerTHead.children.length + 1 }
           ),
         ],
--- a/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
+++ b/toolkit/locales/en-US/toolkit/about/aboutSupport.ftl
@@ -187,16 +187,20 @@ support-third-party-modules-module = Mod
 support-third-party-modules-version = File Version
 support-third-party-modules-vendor = Vendor Info
 support-third-party-modules-occurrence = Occurrence
 support-third-party-modules-process = Process Type & ID
 support-third-party-modules-thread = Thread
 support-third-party-modules-base = Imagebase Address
 support-third-party-modules-uptime = Process Uptime (ms)
 support-third-party-modules-duration = Loading Duration (ms)
+support-third-party-modules-status = Status
+support-third-party-modules-status-loaded = Loaded
+support-third-party-modules-status-blocked = Blocked
+support-third-party-modules-status-redirected = Redirected
 support-third-party-modules-empty = No third-party modules were loaded.
 support-third-party-modules-no-value = (No value)
 support-third-party-modules-button-open =
     .title = Open file location…
 support-third-party-modules-expand =
     .title = Show detailed information
 support-third-party-modules-collapse =
     .title = Collapse detailed information