From fb34f9ae991b42cc21e711875cf0ecf7f141bb9e Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Wed, 9 Jan 2019 09:44:15 +0000 Subject: [PATCH] Bug 1495382 - Check isMultiE10s from runtime info;r=daisuke,ladybenko Depends on D15081 Differential Revision: https://phabricator.services.mozilla.com/D15399 --HG-- rename : devtools/client/shared/multi-e10s-helper.js => devtools/shared/multi-e10s-helper.js extra : moz-landing-system : lando --- .../aboutdebugging-new/aboutdebugging.js | 14 ------ .../src/actions/runtimes.js | 43 ++++++++++++++++++- .../aboutdebugging-new/src/actions/ui.js | 8 ---- .../debugtarget/ServiceWorkerAction.js | 9 ++-- .../aboutdebugging-new/src/constants.js | 4 +- .../aboutdebugging-new/src/create-store.js | 3 +- .../src/modules/client-wrapper.js | 9 +++- .../src/modules/runtimes-state-helper.js | 1 + .../src/reducers/runtimes-state.js | 10 +++++ .../src/reducers/ui-state.js | 9 +--- .../aboutdebugging-new/src/types/index.js | 3 +- .../aboutdebugging-new/src/types/runtime.js | 5 +++ .../mocks/helper-client-wrapper-mock.js | 2 + .../components/workers/Panel.js | 2 +- devtools/client/shared/moz.build | 1 - devtools/server/actors/device.js | 16 ++++++- devtools/shared/moz.build | 1 + .../{client => }/shared/multi-e10s-helper.js | 0 devtools/shared/specs/device.js | 10 ++++- devtools/shared/system.js | 2 +- 20 files changed, 105 insertions(+), 47 deletions(-) rename devtools/{client => }/shared/multi-e10s-helper.js (100%) diff --git a/devtools/client/aboutdebugging-new/aboutdebugging.js b/devtools/client/aboutdebugging-new/aboutdebugging.js index a1376f0fc3da9..4e189d72cdfe5 100644 --- a/devtools/client/aboutdebugging-new/aboutdebugging.js +++ b/devtools/client/aboutdebugging-new/aboutdebugging.js @@ -32,12 +32,6 @@ const { removeUSBRuntimesObserver, } = require("./src/modules/usb-runtimes"); -const { - addMultiE10sListener, - isMultiE10s, - removeMultiE10sListener, -} = require("devtools/client/shared/multi-e10s-helper"); - loader.lazyRequireGetter(this, "adbAddon", "devtools/shared/adb/adb-addon", true); const Router = createFactory(require("devtools/client/shared/vendor/react-router-dom").HashRouter); @@ -54,7 +48,6 @@ const AboutDebugging = { this.onAdbAddonUpdated = this.onAdbAddonUpdated.bind(this); this.onNetworkLocationsUpdated = this.onNetworkLocationsUpdated.bind(this); this.onUSBRuntimesUpdated = this.onUSBRuntimesUpdated.bind(this); - this.onMultiE10sUpdated = this.onMultiE10sUpdated.bind(this); this.store = configureStore(); this.actions = bindActionCreators(actions, this.store.dispatch); @@ -90,12 +83,6 @@ const AboutDebugging = { // Remove deprecated remote debugging extensions. await adbAddon.uninstallUnsupportedExtensions(); - - addMultiE10sListener(this.onMultiE10sUpdated); - }, - - onMultiE10sUpdated() { - this.actions.updateMultiE10sStatus(isMultiE10s()); }, onAdbAddonUpdated() { @@ -123,7 +110,6 @@ const AboutDebugging = { // Remove all client listeners. this.actions.removeRuntimeListeners(); - removeMultiE10sListener(this.onMultiE10sUpdated); removeNetworkLocationsObserver(this.onNetworkLocationsUpdated); removeUSBRuntimesObserver(this.onUSBRuntimesUpdated); adbAddon.off("update", this.onAdbAddonUpdated); diff --git a/devtools/client/aboutdebugging-new/src/actions/runtimes.js b/devtools/client/aboutdebugging-new/src/actions/runtimes.js index 2cbbf8dedb367..5d076fa99e5b5 100644 --- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js +++ b/devtools/client/aboutdebugging-new/src/actions/runtimes.js @@ -35,6 +35,9 @@ const { UPDATE_CONNECTION_PROMPT_SETTING_FAILURE, UPDATE_CONNECTION_PROMPT_SETTING_START, UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS, + UPDATE_RUNTIME_MULTIE10S_FAILURE, + UPDATE_RUNTIME_MULTIE10S_START, + UPDATE_RUNTIME_MULTIE10S_SUCCESS, WATCH_RUNTIME_FAILURE, WATCH_RUNTIME_START, WATCH_RUNTIME_SUCCESS, @@ -42,7 +45,7 @@ const { async function getRuntimeInfo(runtime, clientWrapper) { const { type } = runtime; - const { name, channel, deviceName, version } = + const { name, channel, deviceName, isMultiE10s, version } = await clientWrapper.getDeviceDescription(); const icon = (channel === "release" || channel === "beta" || channel === "aurora") @@ -50,8 +53,9 @@ async function getRuntimeInfo(runtime, clientWrapper) { : "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg"; return { - icon, deviceName, + icon, + isMultiE10s, name, type, version, @@ -65,6 +69,10 @@ function onUSBDebuggerClientClosed() { window.AboutDebugging.store.dispatch(Actions.scanUSBRuntimes()); } +function onMultiE10sUpdated() { + window.AboutDebugging.store.dispatch(updateMultiE10s()); +} + function connectRuntime(id) { return async (dispatch, getState) => { dispatch({ type: CONNECT_RUNTIME_START }); @@ -72,6 +80,8 @@ function connectRuntime(id) { const runtime = findRuntimeById(id, getState().runtimes); const clientWrapper = await createClientForRuntime(runtime); const info = await getRuntimeInfo(runtime, clientWrapper); + const { isMultiE10s } = info; + delete info.isMultiE10s; const promptPrefName = RUNTIME_PREFERENCE.CONNECTION_PROMPT; const connectionPromptEnabled = await clientWrapper.getPreference(promptPrefName); @@ -79,8 +89,16 @@ function connectRuntime(id) { clientWrapper, connectionPromptEnabled, info, + isMultiE10s, }; + clientWrapper.addListener("closed", onUSBDebuggerClientClosed); + + const deviceFront = await clientWrapper.getFront("device"); + if (deviceFront) { + deviceFront.on("multi-e10s-updated", onMultiE10sUpdated); + } + if (runtime.type === RUNTIMES.USB) { // `closed` event will be emitted when disabling remote debugging // on the connected USB runtime. @@ -108,6 +126,11 @@ function disconnectRuntime(id) { const runtime = findRuntimeById(id, getState().runtimes); const { clientWrapper } = runtime.runtimeDetails; + const deviceFront = await clientWrapper.getFront("device"); + if (deviceFront) { + deviceFront.off("multi-e10s-updated", onMultiE10sUpdated); + } + if (runtime.type === RUNTIMES.USB) { clientWrapper.removeListener("closed", onUSBDebuggerClientClosed); } @@ -146,6 +169,22 @@ function updateConnectionPromptSetting(connectionPromptEnabled) { }; } +function updateMultiE10s() { + return async (dispatch, getState) => { + dispatch({ type: UPDATE_RUNTIME_MULTIE10S_START }); + try { + const runtime = getCurrentRuntime(getState().runtimes); + const { clientWrapper } = runtime.runtimeDetails; + // Re-get actual value from the runtime. + const { isMultiE10s } = await clientWrapper.getDeviceDescription(); + + dispatch({ type: UPDATE_RUNTIME_MULTIE10S_SUCCESS, runtime, isMultiE10s }); + } catch (e) { + dispatch({ type: UPDATE_RUNTIME_MULTIE10S_FAILURE, error: e }); + } + }; +} + function watchRuntime(id) { return async (dispatch, getState) => { dispatch({ type: WATCH_RUNTIME_START }); diff --git a/devtools/client/aboutdebugging-new/src/actions/ui.js b/devtools/client/aboutdebugging-new/src/actions/ui.js index 55680c0a4e665..a57925e9b5f68 100644 --- a/devtools/client/aboutdebugging-new/src/actions/ui.js +++ b/devtools/client/aboutdebugging-new/src/actions/ui.js @@ -13,7 +13,6 @@ const { ADB_ADDON_UNINSTALL_FAILURE, ADB_ADDON_STATUS_UPDATED, DEBUG_TARGET_COLLAPSIBILITY_UPDATED, - MULTI_E10S_UPDATED, NETWORK_LOCATIONS_UPDATED, PAGE_SELECTED, PAGE_TYPES, @@ -127,12 +126,6 @@ function scanUSBRuntimes() { }; } -function updateMultiE10sStatus(isMultiE10s) { - return (dispatch, getState) => { - dispatch({ type: MULTI_E10S_UPDATED, isMultiE10s}); - }; -} - module.exports = { addNetworkLocation, installAdbAddon, @@ -142,6 +135,5 @@ module.exports = { uninstallAdbAddon, updateAdbAddonStatus, updateDebugTargetCollapsibility, - updateMultiE10sStatus, updateNetworkLocations, }; diff --git a/devtools/client/aboutdebugging-new/src/components/debugtarget/ServiceWorkerAction.js b/devtools/client/aboutdebugging-new/src/components/debugtarget/ServiceWorkerAction.js index ca233edade506..0d8d722cf12cd 100644 --- a/devtools/client/aboutdebugging-new/src/components/debugtarget/ServiceWorkerAction.js +++ b/devtools/client/aboutdebugging-new/src/components/debugtarget/ServiceWorkerAction.js @@ -11,6 +11,8 @@ const { connect } = require("devtools/client/shared/vendor/react-redux"); const FluentReact = require("devtools/client/shared/vendor/fluent-react"); +const { getCurrentRuntimeDetails } = require("../../modules/runtimes-state-helper"); + const InspectAction = createFactory(require("./InspectAction")); const Actions = require("../../actions/index"); @@ -26,7 +28,7 @@ class ServiceWorkerAction extends PureComponent { // Provided by wrapping the component with FluentReact.withLocalization. getString: PropTypes.func.isRequired, // Provided by redux state - isMultiE10s: PropTypes.bool.isRequired, + runtimeDetails: Types.runtimeDetails.isRequired, target: Types.debugTarget.isRequired, }; } @@ -42,8 +44,9 @@ class ServiceWorkerAction extends PureComponent { } _renderAction() { - const { dispatch, isMultiE10s, target } = this.props; + const { dispatch, runtimeDetails, target } = this.props; const { isActive, isRunning } = target.details; + const { isMultiE10s } = runtimeDetails; if (!isRunning) { const startLabel = this.props.getString("about-debugging-worker-action-start"); @@ -95,7 +98,7 @@ class ServiceWorkerAction extends PureComponent { const mapStateToProps = state => { return { - isMultiE10s: state.ui.isMultiE10s, + runtimeDetails: getCurrentRuntimeDetails(state.runtimes), }; }; diff --git a/devtools/client/aboutdebugging-new/src/constants.js b/devtools/client/aboutdebugging-new/src/constants.js index 2dbb60ad7a432..dc45ee74aecbf 100644 --- a/devtools/client/aboutdebugging-new/src/constants.js +++ b/devtools/client/aboutdebugging-new/src/constants.js @@ -19,7 +19,6 @@ const actionTypes = { DISCONNECT_RUNTIME_FAILURE: "DISCONNECT_RUNTIME_FAILURE", DISCONNECT_RUNTIME_START: "DISCONNECT_RUNTIME_START", DISCONNECT_RUNTIME_SUCCESS: "DISCONNECT_RUNTIME_SUCCESS", - MULTI_E10S_UPDATED: "MULTI_E10S_UPDATED", NETWORK_LOCATIONS_UPDATED: "NETWORK_LOCATIONS_UPDATED", PAGE_SELECTED: "PAGE_SELECTED", REMOTE_RUNTIMES_UPDATED: "REMOTE_RUNTIMES_UPDATED", @@ -41,6 +40,9 @@ const actionTypes = { UPDATE_CONNECTION_PROMPT_SETTING_FAILURE: "UPDATE_CONNECTION_PROMPT_SETTING_FAILURE", UPDATE_CONNECTION_PROMPT_SETTING_START: "UPDATE_CONNECTION_PROMPT_SETTING_START", UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS: "UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS", + UPDATE_RUNTIME_MULTIE10S_FAILURE: "UPDATE_RUNTIME_MULTIE10S_FAILURE", + UPDATE_RUNTIME_MULTIE10S_START: "UPDATE_RUNTIME_MULTIE10S_START", + UPDATE_RUNTIME_MULTIE10S_SUCCESS: "UPDATE_RUNTIME_MULTIE10S_SUCCESS", USB_RUNTIMES_SCAN_START: "USB_RUNTIMES_SCAN_START", USB_RUNTIMES_SCAN_SUCCESS: "USB_RUNTIMES_SCAN_SUCCESS", WATCH_RUNTIME_FAILURE: "WATCH_RUNTIME_FAILURE", diff --git a/devtools/client/aboutdebugging-new/src/create-store.js b/devtools/client/aboutdebugging-new/src/create-store.js index 8ddfd34220c64..c78ddb77807de 100644 --- a/devtools/client/aboutdebugging-new/src/create-store.js +++ b/devtools/client/aboutdebugging-new/src/create-store.js @@ -9,7 +9,6 @@ const Services = require("Services"); const { applyMiddleware, createStore } = require("devtools/client/shared/vendor/redux"); const { thunk } = require("devtools/client/shared/redux/middleware/thunk.js"); const { waitUntilService } = require("devtools/client/shared/redux/middleware/wait-service.js"); -const { isMultiE10s } = require("devtools/client/shared/multi-e10s-helper"); const rootReducer = require("./reducers/index"); const { DebugTargetsState } = require("./reducers/debug-targets-state"); @@ -51,7 +50,7 @@ function getUiState() { const showSystemAddons = Services.prefs.getBoolPref(PREFERENCES.SHOW_SYSTEM_ADDONS, false); return new UiState(locations, collapsibilities, networkEnabled, wifiEnabled, - showSystemAddons, isMultiE10s()); + showSystemAddons); } exports.configureStore = configureStore; diff --git a/devtools/client/aboutdebugging-new/src/modules/client-wrapper.js b/devtools/client/aboutdebugging-new/src/modules/client-wrapper.js index 1b7df49e38be1..ff39e0c95b876 100644 --- a/devtools/client/aboutdebugging-new/src/modules/client-wrapper.js +++ b/devtools/client/aboutdebugging-new/src/modules/client-wrapper.js @@ -59,18 +59,23 @@ class ClientWrapper { } } + async getFront(typeName) { + return this.client.mainRoot.getFront(typeName); + } + onFront(typeName, listener) { this.client.mainRoot.onFront(typeName, listener); } async getDeviceDescription() { - const deviceFront = await this.client.mainRoot.getFront("device"); - const { brandName, channel, deviceName, version } = + const deviceFront = await this.getFront("device"); + const { brandName, channel, deviceName, isMultiE10s, version } = await deviceFront.getDescription(); // Only expose a specific set of properties. return { channel, deviceName, + isMultiE10s, name: brandName, version, }; diff --git a/devtools/client/aboutdebugging-new/src/modules/runtimes-state-helper.js b/devtools/client/aboutdebugging-new/src/modules/runtimes-state-helper.js index 50a35104142b9..ae6c7d55511b2 100644 --- a/devtools/client/aboutdebugging-new/src/modules/runtimes-state-helper.js +++ b/devtools/client/aboutdebugging-new/src/modules/runtimes-state-helper.js @@ -46,3 +46,4 @@ function getCurrentRuntimeDetails(runtimesState) { const runtime = getCurrentRuntime(runtimesState); return runtime ? runtime.runtimeDetails : null; } +exports.getCurrentRuntimeDetails = getCurrentRuntimeDetails; diff --git a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js b/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js index fa8f2a3aadb56..6939137cbc85b 100644 --- a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js +++ b/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js @@ -10,6 +10,7 @@ const { RUNTIMES, UNWATCH_RUNTIME_SUCCESS, UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS, + UPDATE_RUNTIME_MULTIE10S_SUCCESS, REMOTE_RUNTIMES_UPDATED, WATCH_RUNTIME_SUCCESS, } = require("../constants"); @@ -97,6 +98,15 @@ function runtimesReducer(state = RuntimesState(), action) { return _updateRuntimeById(runtimeId, { runtimeDetails }, state); } + case UPDATE_RUNTIME_MULTIE10S_SUCCESS: { + const { isMultiE10s } = action; + const { id: runtimeId } = action.runtime; + const runtime = findRuntimeById(runtimeId, state); + const runtimeDetails = + Object.assign({}, runtime.runtimeDetails, { isMultiE10s }); + return _updateRuntimeById(runtimeId, { runtimeDetails }, state); + } + case REMOTE_RUNTIMES_UPDATED: { const { runtimes, runtimeType } = action; const key = TYPE_TO_RUNTIMES_KEY[runtimeType]; diff --git a/devtools/client/aboutdebugging-new/src/reducers/ui-state.js b/devtools/client/aboutdebugging-new/src/reducers/ui-state.js index e659fa91188dc..ff02fd858fc55 100644 --- a/devtools/client/aboutdebugging-new/src/reducers/ui-state.js +++ b/devtools/client/aboutdebugging-new/src/reducers/ui-state.js @@ -7,7 +7,6 @@ const { ADB_ADDON_STATUS_UPDATED, DEBUG_TARGET_COLLAPSIBILITY_UPDATED, - MULTI_E10S_UPDATED, NETWORK_LOCATIONS_UPDATED, PAGE_SELECTED, TEMPORARY_EXTENSION_INSTALL_FAILURE, @@ -18,11 +17,10 @@ const { function UiState(locations = [], debugTargetCollapsibilities = {}, networkEnabled = false, wifiEnabled = false, - showSystemAddons = false, isMultiE10s = false) { + showSystemAddons = false) { return { adbAddonStatus: null, debugTargetCollapsibilities, - isMultiE10s, isScanningUsb: false, networkEnabled, networkLocations: locations, @@ -48,11 +46,6 @@ function uiReducer(state = UiState(), action) { return Object.assign({}, state, { debugTargetCollapsibilities }); } - case MULTI_E10S_UPDATED: { - const { isMultiE10s } = action; - return Object.assign({}, state, { isMultiE10s }); - } - case NETWORK_LOCATIONS_UPDATED: { const { locations } = action; return Object.assign({}, state, { networkLocations: locations }); diff --git a/devtools/client/aboutdebugging-new/src/types/index.js b/devtools/client/aboutdebugging-new/src/types/index.js index fbee6347431dd..e8e9d4445b75c 100644 --- a/devtools/client/aboutdebugging-new/src/types/index.js +++ b/devtools/client/aboutdebugging-new/src/types/index.js @@ -5,9 +5,10 @@ "use strict"; const { debugTarget } = require("./debug-target"); -const { runtime } = require("./runtime"); +const { runtime, runtimeDetails } = require("./runtime"); module.exports = Object.assign({}, { debugTarget, runtime, + runtimeDetails, }); diff --git a/devtools/client/aboutdebugging-new/src/types/runtime.js b/devtools/client/aboutdebugging-new/src/types/runtime.js index a8f768b345cb1..5337d0adef65b 100644 --- a/devtools/client/aboutdebugging-new/src/types/runtime.js +++ b/devtools/client/aboutdebugging-new/src/types/runtime.js @@ -31,7 +31,12 @@ const runtimeDetails = { // runtime information info: PropTypes.shape(runtimeInfo).isRequired, + + // True if this runtime supports multiple content processes + // This might be undefined when connecting to runtimes older than Fx 66 + isMultiE10s: PropTypes.bool, }; +exports.runtimeDetails = PropTypes.shape(runtimeDetails); const networkRuntimeConnectionParameter = { // host name of debugger server to connect diff --git a/devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js b/devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js index e12a7cae5b591..7554f855b500e 100644 --- a/devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js +++ b/devtools/client/aboutdebugging-new/test/browser/mocks/helper-client-wrapper-mock.js @@ -76,6 +76,8 @@ function createClientMock() { sharedWorkers: [], }), // no-op + getFront: () => {}, + // no-op onFront: () => {}, // stores the preference locally (doesn't update about:config) setPreference: function(prefName, value) { diff --git a/devtools/client/aboutdebugging/components/workers/Panel.js b/devtools/client/aboutdebugging/components/workers/Panel.js index e5c9dd8c07ff7..0bc8a52c8871a 100644 --- a/devtools/client/aboutdebugging/components/workers/Panel.js +++ b/devtools/client/aboutdebugging/components/workers/Panel.js @@ -15,7 +15,7 @@ const { addMultiE10sListener, isMultiE10s, removeMultiE10sListener, -} = require("devtools/client/shared/multi-e10s-helper"); +} = require("devtools/shared/multi-e10s-helper"); const PanelHeader = createFactory(require("../PanelHeader")); const TargetList = createFactory(require("../TargetList")); diff --git a/devtools/client/shared/moz.build b/devtools/client/shared/moz.build index 6148d21de3320..45f2c651d3da7 100644 --- a/devtools/client/shared/moz.build +++ b/devtools/client/shared/moz.build @@ -37,7 +37,6 @@ DevToolsModules( 'key-shortcuts.js', 'keycodes.js', 'link.js', - 'multi-e10s-helper.js', 'natural-sort.js', 'node-attribute-parser.js', 'options-view.js', diff --git a/devtools/server/actors/device.js b/devtools/server/actors/device.js index d9a71a7a3181a..67e028480be9b 100644 --- a/devtools/server/actors/device.js +++ b/devtools/server/actors/device.js @@ -8,6 +8,12 @@ const {Ci, Cc} = require("chrome"); const Services = require("Services"); const protocol = require("devtools/shared/protocol"); const {LongStringActor} = require("devtools/server/actors/string"); +const { + addMultiE10sListener, + isMultiE10s, + removeMultiE10sListener, +} = require("devtools/shared/multi-e10s-helper"); + const {DebuggerServer} = require("devtools/server/main"); const {getSystemInfo} = require("devtools/shared/system"); const {deviceSpec} = require("devtools/shared/specs/device"); @@ -23,6 +29,9 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, { this._window.addEventListener("pageshow", this._onPageShow, true); } this._acquireWakeLock(); + + this._onMultiE10sUpdated = this._onMultiE10sUpdated.bind(this); + addMultiE10sListener(this._onMultiE10sUpdated); }, destroy: function() { @@ -31,10 +40,15 @@ exports.DeviceActor = protocol.ActorClassWithSpec(deviceSpec, { if (this._window) { this._window.removeEventListener("pageshow", this._onPageShow, true); } + removeMultiE10sListener(this._onMultiE10sUpdated); + }, + + _onMultiE10sUpdated: function() { + this.emit("multi-e10s-updated", isMultiE10s()); }, getDescription: function() { - return getSystemInfo(); + return Object.assign({}, getSystemInfo(), { isMultiE10s: isMultiE10s() }); }, screenshotToDataURL: function() { diff --git a/devtools/shared/moz.build b/devtools/shared/moz.build index f44017ea5f81c..4d2fe0430db96 100644 --- a/devtools/shared/moz.build +++ b/devtools/shared/moz.build @@ -65,6 +65,7 @@ DevToolsModules( 'l10n.js', 'loader-plugin-raw.jsm', 'Loader.jsm', + 'multi-e10s-helper.js', 'Parser.jsm', 'path.js', 'plural-form.js', diff --git a/devtools/client/shared/multi-e10s-helper.js b/devtools/shared/multi-e10s-helper.js similarity index 100% rename from devtools/client/shared/multi-e10s-helper.js rename to devtools/shared/multi-e10s-helper.js diff --git a/devtools/shared/specs/device.js b/devtools/shared/specs/device.js index 2fa7e5ae173fa..551149d7c34b5 100644 --- a/devtools/shared/specs/device.js +++ b/devtools/shared/specs/device.js @@ -3,11 +3,17 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; -const {RetVal, generateActorSpec} = require("devtools/shared/protocol"); - +const { Arg, RetVal, generateActorSpec } = require("devtools/shared/protocol"); const deviceSpec = generateActorSpec({ typeName: "device", + events: { + "multi-e10s-updated": { + type: "multi-e10s-updated", + isMultiE10s: Arg(0, "boolean"), + }, + }, + methods: { getDescription: {request: {}, response: { value: RetVal("json")}}, screenshotToDataURL: {request: {}, response: { value: RetVal("longstring")}}, diff --git a/devtools/shared/system.js b/devtools/shared/system.js index e6985e9da24d9..0069bcb902cf2 100644 --- a/devtools/shared/system.js +++ b/devtools/shared/system.js @@ -35,7 +35,7 @@ const APP_MAP = { var CACHED_INFO = null; -async function getSystemInfo() { +function getSystemInfo() { if (CACHED_INFO) { return CACHED_INFO; }