Backed out changeset 650ac3a6c73d (bug 1488507) for causing merge conflicts.
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Thu, 04 Oct 2018 18:47:04 +0300
changeset 495356 12569187299b76c96cd6ea568f852f0de78e46cc
parent 495355 1b1d6fa744e7a7ceaf6e680ca450441a160fc00f
child 495357 452e1706609f7bfc1912153e684ded99df7a990d
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1488507
milestone64.0a1
backs out650ac3a6c73de80182fca223666e3f7595e1676e
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
Backed out changeset 650ac3a6c73d (bug 1488507) for causing merge conflicts.
devtools/client/aboutdebugging-new/src/actions/runtimes.js
devtools/client/aboutdebugging-new/src/components/RuntimePage.js
devtools/client/aboutdebugging-new/src/modules/debug-target-support.js
devtools/client/aboutdebugging-new/src/modules/moz.build
--- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js
+++ b/devtools/client/aboutdebugging-new/src/actions/runtimes.js
@@ -8,23 +8,21 @@ const { ADB } = require("devtools/shared
 const { DebuggerClient } = require("devtools/shared/client/debugger-client");
 const { DebuggerServer } = require("devtools/server/main");
 
 const Actions = require("./index");
 
 const {
   findRuntimeById,
 } = require("../modules/runtimes-state-helper");
-const { isSupportedDebugTarget } = require("../modules/debug-target-support");
 
 const {
   CONNECT_RUNTIME_FAILURE,
   CONNECT_RUNTIME_START,
   CONNECT_RUNTIME_SUCCESS,
-  DEBUG_TARGETS,
   DISCONNECT_RUNTIME_FAILURE,
   DISCONNECT_RUNTIME_START,
   DISCONNECT_RUNTIME_SUCCESS,
   RUNTIMES,
   UNWATCH_RUNTIME_FAILURE,
   UNWATCH_RUNTIME_START,
   UNWATCH_RUNTIME_SUCCESS,
   USB_RUNTIMES_UPDATED,
@@ -64,29 +62,28 @@ async function createClientForRuntime(ru
   } else if (type === RUNTIMES.USB) {
     return createUSBClient(runtime.socketPath);
   }
 
   return null;
 }
 
 async function getRuntimeInfo(runtime, client) {
-  const { model, type } = runtime;
+  const { model } = runtime;
   const deviceFront = await client.mainRoot.getFront("device");
   const { brandName: name, channel, version } = await deviceFront.getDescription();
   const icon =
     (channel === "release" || channel === "beta" || channel === "aurora")
       ? `chrome://devtools/skin/images/aboutdebugging-firefox-${ channel }.svg`
       : "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
 
   return {
     icon,
     model,
     name,
-    type,
     version,
   };
 }
 
 function connectRuntime(id) {
   return async (dispatch, getState) => {
     dispatch({ type: CONNECT_RUNTIME_START });
     try {
@@ -141,27 +138,19 @@ function watchRuntime(id) {
         // THIS_FIREFOX connects and disconnects on the fly when opening the page.
         await dispatch(connectRuntime(RUNTIMES.THIS_FIREFOX));
       }
 
       // The selected runtime should already have a connected client assigned.
       const runtime = findRuntimeById(id, getState().runtimes);
       await dispatch({ type: WATCH_RUNTIME_SUCCESS, runtime });
 
-      if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.EXTENSION)) {
-        dispatch(Actions.requestExtensions());
-      }
-
-      if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.TAB)) {
-        dispatch(Actions.requestTabs());
-      }
-
-      if (isSupportedDebugTarget(runtime.type, DEBUG_TARGETS.WORKER)) {
-        dispatch(Actions.requestWorkers());
-      }
+      dispatch(Actions.requestExtensions());
+      dispatch(Actions.requestTabs());
+      dispatch(Actions.requestWorkers());
     } catch (e) {
       dispatch({ type: WATCH_RUNTIME_FAILURE, error: e.message });
     }
   };
 }
 
 function unwatchRuntime(id) {
   return async (dispatch, getState) => {
--- a/devtools/client/aboutdebugging-new/src/components/RuntimePage.js
+++ b/devtools/client/aboutdebugging-new/src/components/RuntimePage.js
@@ -20,60 +20,35 @@ const ServiceWorkerAction = createFactor
 const TabDetail = createFactory(require("./debugtarget/TabDetail"));
 const TemporaryExtensionAction = createFactory(require("./debugtarget/TemporaryExtensionAction"));
 const TemporaryExtensionInstaller =
   createFactory(require("./debugtarget/TemporaryExtensionInstaller"));
 const WorkerDetail = createFactory(require("./debugtarget/WorkerDetail"));
 
 const { DEBUG_TARGET_PANE } = require("../constants");
 const { getCurrentRuntimeInfo } = require("../modules/runtimes-state-helper");
-const { isSupportedDebugTargetPane } = require("../modules/debug-target-support");
 
 class RuntimePage extends PureComponent {
   static get propTypes() {
     return {
       collapsibilities: PropTypes.object.isRequired,
       dispatch: PropTypes.func.isRequired,
       installedExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
       otherWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       runtimeInfo: PropTypes.object,
       serviceWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       sharedWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
       tabs: PropTypes.arrayOf(PropTypes.object).isRequired,
       temporaryExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
     };
   }
 
-  renderDebugTargetPane(name, targets, actionComponent,
-                        detailComponent, paneKey, localizationId) {
-    const { collapsibilities, dispatch, runtimeInfo } = this.props;
-
-    if (!isSupportedDebugTargetPane(runtimeInfo.type, paneKey)) {
-      return null;
-    }
-
-    return Localized(
-      {
-        id: localizationId,
-        attrs: { name: true }
-      },
-      DebugTargetPane({
-        actionComponent,
-        collapsibilityKey: paneKey,
-        detailComponent,
-        dispatch,
-        isCollapsed: collapsibilities.get(paneKey),
-        name,
-        targets,
-      })
-    );
-  }
-
   render() {
     const {
+      collapsibilities,
       dispatch,
       installedExtensions,
       otherWorkers,
       runtimeInfo,
       serviceWorkers,
       sharedWorkers,
       tabs,
       temporaryExtensions,
@@ -85,55 +60,107 @@ class RuntimePage extends PureComponent 
       return null;
     }
 
     return dom.article(
       {
         className: "page js-runtime-page",
       },
       RuntimeInfo(runtimeInfo),
-      isSupportedDebugTargetPane(runtimeInfo.type, DEBUG_TARGET_PANE.TEMPORARY_EXTENSION)
-        ? TemporaryExtensionInstaller({ dispatch })
-        : null,
-      this.renderDebugTargetPane("Temporary Extensions",
-                                 temporaryExtensions,
-                                 TemporaryExtensionAction,
-                                 ExtensionDetail,
-                                 DEBUG_TARGET_PANE.TEMPORARY_EXTENSION,
-                                 "about-debugging-runtime-temporary-extensions"),
-      this.renderDebugTargetPane("Extensions",
-                                 installedExtensions,
-                                 InspectAction,
-                                 ExtensionDetail,
-                                 DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
-                                 "about-debugging-runtime-extensions"),
-      this.renderDebugTargetPane("Tabs",
-                                 tabs,
-                                 InspectAction,
-                                 TabDetail,
-                                 DEBUG_TARGET_PANE.TAB,
-                                 "about-debugging-runtime-tabs"),
-      this.renderDebugTargetPane("Service Workers",
-                                 serviceWorkers,
-                                 ServiceWorkerAction,
-                                 WorkerDetail,
-                                 DEBUG_TARGET_PANE.SERVICE_WORKER,
-                                 "about-debugging-runtime-service-workers"),
-      this.renderDebugTargetPane("Shared Workers",
-                                 sharedWorkers,
-                                 InspectAction,
-                                 WorkerDetail,
-                                 DEBUG_TARGET_PANE.SHARED_WORKER,
-                                 "about-debugging-runtime-shared-workers"),
-      this.renderDebugTargetPane("Other Workers",
-                                 otherWorkers,
-                                 InspectAction,
-                                 WorkerDetail,
-                                 DEBUG_TARGET_PANE.OTHER_WORKER,
-                                 "about-debugging-runtime-other-workers"),
+      TemporaryExtensionInstaller({ dispatch }),
+      Localized(
+        {
+          id: "about-debugging-runtime-temporary-extensions",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: TemporaryExtensionAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.TEMPORARY_EXTENSION,
+          detailComponent: ExtensionDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.TEMPORARY_EXTENSION),
+          name: "Temporary Extensions",
+          targets: temporaryExtensions,
+        })
+      ),
+      Localized(
+        {
+          id: "about-debugging-runtime-extensions",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: InspectAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
+          detailComponent: ExtensionDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.INSTALLED_EXTENSION),
+          name: "Extensions",
+          targets: installedExtensions,
+        })
+      ),
+      Localized(
+        {
+          id: "about-debugging-runtime-tabs",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: InspectAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.TAB,
+          detailComponent: TabDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.TAB),
+          name: "Tabs",
+          targets: tabs
+        })
+      ),
+      Localized(
+        {
+          id: "about-debugging-runtime-service-workers",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: ServiceWorkerAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.SERVICE_WORKER,
+          detailComponent: WorkerDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.SERVICE_WORKER),
+          name: "Service Workers",
+          targets: serviceWorkers
+        })
+      ),
+      Localized(
+        {
+          id: "about-debugging-runtime-shared-workers",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: InspectAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.SHARED_WORKER,
+          detailComponent: WorkerDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.SHARED_WORKER),
+          name: "Shared Workers",
+          targets: sharedWorkers
+        })
+      ),
+      Localized(
+        {
+          id: "about-debugging-runtime-other-workers",
+          attrs: { name: true }
+        },
+        DebugTargetPane({
+          actionComponent: InspectAction,
+          collapsibilityKey: DEBUG_TARGET_PANE.OTHER_WORKER,
+          detailComponent: WorkerDetail,
+          dispatch,
+          isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.OTHER_WORKER),
+          name: "Other Workers",
+          targets: otherWorkers
+        })
+      ),
     );
   }
 }
 
 const mapStateToProps = state => {
   return {
     collapsibilities: state.ui.debugTargetCollapsibilities,
     installedExtensions: state.debugTargets.installedExtensions,
deleted file mode 100644
--- a/devtools/client/aboutdebugging-new/src/modules/debug-target-support.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 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 { DEBUG_TARGETS, DEBUG_TARGET_PANE, RUNTIMES } = require("../constants");
-
-function isSupportedDebugTarget(runtimeType, debugTargetType) {
-  if (runtimeType === RUNTIMES.THIS_FIREFOX) {
-    return true;
-  }
-
-  return debugTargetType === DEBUG_TARGETS.TAB;
-}
-exports.isSupportedDebugTarget = isSupportedDebugTarget;
-
-function isSupportedDebugTargetPane(runtimeType, debugTargetPaneKey) {
-  if (runtimeType === RUNTIMES.THIS_FIREFOX) {
-    return true;
-  }
-
-  return debugTargetPaneKey === DEBUG_TARGET_PANE.TAB;
-}
-exports.isSupportedDebugTargetPane = isSupportedDebugTargetPane;
--- a/devtools/client/aboutdebugging-new/src/modules/moz.build
+++ b/devtools/client/aboutdebugging-new/src/modules/moz.build
@@ -1,12 +1,11 @@
 # 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/.
 
 DevToolsModules(
     'debug-target-collapsibilities.js',
-    'debug-target-support.js',
     'extensions-helper.js',
     'network-locations.js',
     'runtimes-state-helper.js',
     'usb-runtimes.js',
 )