Bug 1740438 - [devtools] Remove backward compatibility code for recordAllocations target configuration option r=devtools-reviewers,bomsy

Depends on D130847

Differential Revision: https://phabricator.services.mozilla.com/D130848
This commit is contained in:
Julian Descottes 2021-11-16 14:34:27 +00:00
parent 474ba47047
commit d226afc848
2 changed files with 6 additions and 8 deletions

View file

@ -12,12 +12,8 @@ exports.toggleRecordingAllocationStacks = function(commands) {
return async function({ dispatch, getState }) { return async function({ dispatch, getState }) {
dispatch({ type: actions.TOGGLE_RECORD_ALLOCATION_STACKS_START }); dispatch({ type: actions.TOGGLE_RECORD_ALLOCATION_STACKS_START });
const { targetConfigurationCommand } = commands; if (commands.targetCommand.hasTargetWatcherSupport()) {
// @backward-compat { version 94 } Starts supporting "recordAllocations" configuration in order to better support SSTS await commands.targetConfigurationCommand.updateConfiguration({
// Could only be dropped once we support targetConfiguration for all toolboxes (either we drop the Browser content toolbox, or support the content process in watcher actor)
// Once Fx93 support is removed, we can replace this check with `commands.targetCommand.hasTargetWatcherSupport()` to check if the watcher is supported.
if (targetConfigurationCommand.supports("recordAllocations")) {
await targetConfigurationCommand.updateConfiguration({
recordAllocations: getState().recordingAllocationStacks recordAllocations: getState().recordingAllocationStacks
? null ? null
: ALLOCATION_RECORDING_OPTIONS, : ALLOCATION_RECORDING_OPTIONS,

View file

@ -16,10 +16,12 @@ add_task(async function() {
await front.attach(); await front.attach();
// Implement the minimal mock, doing nothing to make toggleRecordingAllocationStacks pass // Implement the minimal mock, doing nothing to make toggleRecordingAllocationStacks pass
const commands = { const commands = {
targetConfigurationCommand: { targetCommand: {
supports() { hasTargetWatcherSupport() {
return true; return true;
}, },
},
targetConfigurationCommand: {
updateConfiguration() {}, updateConfiguration() {},
}, },
}; };