From d226afc848bcf3f8e8f41b7cdc9b23ec8d3ca50c Mon Sep 17 00:00:00 2001 From: Julian Descottes Date: Tue, 16 Nov 2021 14:34:27 +0000 Subject: [PATCH] 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 --- devtools/client/memory/actions/allocations.js | 8 ++------ .../xpcshell/test_action-toggle-recording-allocations.js | 6 ++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/devtools/client/memory/actions/allocations.js b/devtools/client/memory/actions/allocations.js index b70ad17b20a6..b71658bc4f1c 100644 --- a/devtools/client/memory/actions/allocations.js +++ b/devtools/client/memory/actions/allocations.js @@ -12,12 +12,8 @@ exports.toggleRecordingAllocationStacks = function(commands) { return async function({ dispatch, getState }) { dispatch({ type: actions.TOGGLE_RECORD_ALLOCATION_STACKS_START }); - const { targetConfigurationCommand } = commands; - // @backward-compat { version 94 } Starts supporting "recordAllocations" configuration in order to better support SSTS - // 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({ + if (commands.targetCommand.hasTargetWatcherSupport()) { + await commands.targetConfigurationCommand.updateConfiguration({ recordAllocations: getState().recordingAllocationStacks ? null : ALLOCATION_RECORDING_OPTIONS, diff --git a/devtools/client/memory/test/xpcshell/test_action-toggle-recording-allocations.js b/devtools/client/memory/test/xpcshell/test_action-toggle-recording-allocations.js index 0cee8c768971..54b6da4f18ca 100644 --- a/devtools/client/memory/test/xpcshell/test_action-toggle-recording-allocations.js +++ b/devtools/client/memory/test/xpcshell/test_action-toggle-recording-allocations.js @@ -16,10 +16,12 @@ add_task(async function() { await front.attach(); // Implement the minimal mock, doing nothing to make toggleRecordingAllocationStacks pass const commands = { - targetConfigurationCommand: { - supports() { + targetCommand: { + hasTargetWatcherSupport() { return true; }, + }, + targetConfigurationCommand: { updateConfiguration() {}, }, };