summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors/resources/index.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:50 +0000
commitdef92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch)
tree2ef34b9ad8bb9a9220e05d60352558b15f513894 /devtools/server/actors/resources/index.js
parentAdding debian version 125.0.3-1. (diff)
downloadfirefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz
firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/server/actors/resources/index.js')
-rw-r--r--devtools/server/actors/resources/index.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/devtools/server/actors/resources/index.js b/devtools/server/actors/resources/index.js
index e2857502ad..cfc941a161 100644
--- a/devtools/server/actors/resources/index.js
+++ b/devtools/server/actors/resources/index.js
@@ -390,6 +390,14 @@ exports.hasResourceTypesForTargets = hasResourceTypesForTargets;
* List of all type of resource to stop listening to.
*/
function unwatchResources(rootOrWatcherOrTargetActor, resourceTypes) {
+ // If we are given a target actor, filter out the resource types supported by the target.
+ // When using sharedData to pass types between processes, we are passing them for all target types.
+ const { targetType } = rootOrWatcherOrTargetActor;
+ // Only target actors usecase will have a target type.
+ // For Root and Watcher we process the `resourceTypes` list unfiltered.
+ if (targetType) {
+ resourceTypes = getResourceTypesForTargetType(resourceTypes, targetType);
+ }
for (const resourceType of resourceTypes) {
// Pull all info about this resource type from `Resources` global object
const { watchers } = getResourceTypeEntry(
@@ -415,6 +423,14 @@ exports.unwatchResources = unwatchResources;
* List of all type of resource to clear.
*/
function clearResources(rootOrWatcherOrTargetActor, resourceTypes) {
+ // If we are given a target actor, filter out the resource types supported by the target.
+ // When using sharedData to pass types between processes, we are passing them for all target types.
+ const { targetType } = rootOrWatcherOrTargetActor;
+ // Only target actors usecase will have a target type.
+ // For Root and Watcher we process the `resourceTypes` list unfiltered.
+ if (targetType) {
+ resourceTypes = getResourceTypesForTargetType(resourceTypes, targetType);
+ }
for (const resourceType of resourceTypes) {
const { watchers } = getResourceTypeEntry(
rootOrWatcherOrTargetActor,