Bug 1603366 - Rename the Main process target in about:debugging when Multiprocess toolbox is enabled r=ladybenko,fluent-reviewers,flod
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 13 Dec 2019 12:02:31 +0000
changeset 506886 a57473caa2871a8ef3a38a7172b57ab5ad0b1ff6
parent 506885 3211056a72a7ce3262010fc563c5ab8139f6ef63
child 506887 162eb0db41958eba57661cbf2ece98feac508ac8
push id36913
push useropoprus@mozilla.com
push dateFri, 13 Dec 2019 16:53:24 +0000
treeherdermozilla-central@1ed684598bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersladybenko, fluent-reviewers, flod
bugs1603366
milestone73.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 1603366 - Rename the Main process target in about:debugging when Multiprocess toolbox is enabled r=ladybenko,fluent-reviewers,flod Depends on D56877 Differential Revision: https://phabricator.services.mozilla.com/D56914
devtools/client/aboutdebugging/src/constants.js
devtools/client/aboutdebugging/src/middleware/process-component-data.js
devtools/client/locales/en-US/aboutdebugging.ftl
--- a/devtools/client/aboutdebugging/src/constants.js
+++ b/devtools/client/aboutdebugging/src/constants.js
@@ -100,16 +100,20 @@ const MESSAGE_LEVEL = {
 };
 
 const PAGE_TYPES = {
   RUNTIME: "runtime",
   CONNECT: "connect",
 };
 
 const PREFERENCES = {
+  // Preference that enables the Multiprocess Browser Toolbox. This will also
+  // enable inspecting Content processes when opening a "Main Process" toolbox
+  // on a remote target.
+  FISSION_BROWSER_TOOLBOX: "devtools.browsertoolbox.fission",
   // Preference that drives the display of the "Tabs" category on This Firefox.
   LOCAL_TAB_DEBUGGING_ENABLED: "devtools.aboutdebugging.local-tab-debugging",
   // Preference that drives the display of the "Processes" debug target category.
   PROCESS_DEBUGGING_ENABLED: "devtools.aboutdebugging.process-debugging",
   // Preference that drives the display of hidden & system addons in about:debugging.
   SHOW_HIDDEN_ADDONS: "devtools.aboutdebugging.showHiddenAddons",
   // Preference to store the last path used for loading a temporary extension.
   TEMPORARY_EXTENSION_PATH: "devtools.aboutdebugging.tmpExtDirPath",
--- a/devtools/client/aboutdebugging/src/middleware/process-component-data.js
+++ b/devtools/client/aboutdebugging/src/middleware/process-component-data.js
@@ -1,17 +1,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
+const Services = require("Services");
 const { l10n } = require("../modules/l10n");
 
-const { DEBUG_TARGETS, REQUEST_PROCESSES_SUCCESS } = require("../constants");
+const {
+  DEBUG_TARGETS,
+  PREFERENCES,
+  REQUEST_PROCESSES_SUCCESS,
+} = require("../constants");
 
 /**
  * This middleware converts tabs object that get from DebuggerClient.listProcesses() to
  * data which is used in DebugTargetItem.
  */
 const processComponentDataMiddleware = store => next => action => {
   switch (action.type) {
     case REQUEST_PROCESSES_SUCCESS: {
@@ -25,21 +30,30 @@ const processComponentDataMiddleware = s
 
   return next(action);
 };
 
 function toMainProcessComponentData(process) {
   const type = DEBUG_TARGETS.PROCESS;
   const id = process.processFront.actorID;
   const icon = "chrome://devtools/skin/images/aboutdebugging-process-icon.svg";
-  const name = l10n.getString("about-debugging-main-process-name");
-  const description = l10n.getString(
-    "about-debugging-main-process-description2"
+
+  const isMultiProcessToolboxEnabled = Services.prefs.getBoolPref(
+    PREFERENCES.FISSION_BROWSER_TOOLBOX,
+    false
   );
 
+  const name = isMultiProcessToolboxEnabled
+    ? l10n.getString("about-debugging-multiprocess-toolbox-name")
+    : l10n.getString("about-debugging-main-process-name");
+
+  const description = isMultiProcessToolboxEnabled
+    ? l10n.getString("about-debugging-multiprocess-toolbox-description")
+    : l10n.getString("about-debugging-main-process-description2");
+
   return {
     name,
     icon,
     id,
     type,
     details: {
       description,
       processId: process.id,
--- a/devtools/client/locales/en-US/aboutdebugging.ftl
+++ b/devtools/client/locales/en-US/aboutdebugging.ftl
@@ -366,16 +366,23 @@ about-debugging-worker-inspect-action-di
 # Displayed as name for the Main Process debug target in the Processes category. Only for
 # remote runtimes, if `devtools.aboutdebugging.process-debugging` is true.
 about-debugging-main-process-name = Main Process
 
 # Displayed as description for the Main Process debug target in the Processes category.
 # Only for remote browsers, if `devtools.aboutdebugging.process-debugging` is true.
 about-debugging-main-process-description2 = Main Process for the target browser
 
+# Displayed instead of the Main Process debug target when the preference
+# `devtools.browsertoolbox.fission` is true.
+about-debugging-multiprocess-toolbox-name = Multiprocess Toolbox
+
+# Description for the Multiprocess Toolbox target.
+about-debugging-multiprocess-toolbox-description = Main Process and Content Processes for the target browser
+
 # Alt text used for the close icon of message component (warnings, errors and notifications).
 about-debugging-message-close-icon =
   .alt = Close message
 
 # Label text used for the error details of message component.
 about-debugging-message-details-label-error = Error details
 
 # Label text used for the warning details of message component.