summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors/targets/session-data-processors
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/server/actors/targets/session-data-processors')
-rw-r--r--devtools/server/actors/targets/session-data-processors/blackboxing.js2
-rw-r--r--devtools/server/actors/targets/session-data-processors/breakpoints.js14
-rw-r--r--devtools/server/actors/targets/session-data-processors/event-breakpoints.js2
-rw-r--r--devtools/server/actors/targets/session-data-processors/resources.js2
-rw-r--r--devtools/server/actors/targets/session-data-processors/target-configuration.js9
-rw-r--r--devtools/server/actors/targets/session-data-processors/thread-configuration.js21
-rw-r--r--devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js2
7 files changed, 33 insertions, 19 deletions
diff --git a/devtools/server/actors/targets/session-data-processors/blackboxing.js b/devtools/server/actors/targets/session-data-processors/blackboxing.js
index 70f4397a72..92bfa74569 100644
--- a/devtools/server/actors/targets/session-data-processors/blackboxing.js
+++ b/devtools/server/actors/targets/session-data-processors/blackboxing.js
@@ -20,7 +20,7 @@ module.exports = {
}
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry(targetActor, entries) {
for (const { url, range } of entries) {
targetActor.sourcesManager.unblackBox(url, range);
}
diff --git a/devtools/server/actors/targets/session-data-processors/breakpoints.js b/devtools/server/actors/targets/session-data-processors/breakpoints.js
index ff7cb7ec0a..67c270654d 100644
--- a/devtools/server/actors/targets/session-data-processors/breakpoints.js
+++ b/devtools/server/actors/targets/session-data-processors/breakpoints.js
@@ -7,6 +7,7 @@
const {
STATES: THREAD_STATES,
} = require("resource://devtools/server/actors/thread.js");
+const Targets = require("resource://devtools/server/actors/targets/index.js");
module.exports = {
async addOrSetSessionDataEntry(
@@ -15,6 +16,17 @@ module.exports = {
isDocumentCreation,
updateType
) {
+ // When debugging the whole browser (via the Browser Toolbox), we instantiate both content process and window global (FRAME) targets.
+ // But the debugger will only use the content process target's thread actor.
+ // Thread actor, Sources and Breakpoints have to be only managed for the content process target,
+ // and we should explicitly ignore the window global target.
+ if (
+ targetActor.sessionContext.type == "all" &&
+ targetActor.targetType === Targets.TYPES.FRAME &&
+ targetActor.typeName != "parentProcessTarget"
+ ) {
+ return;
+ }
const { threadActor } = targetActor;
if (updateType == "set") {
threadActor.removeAllBreakpoints();
@@ -37,7 +49,7 @@ module.exports = {
}
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry(targetActor, entries) {
for (const { location } of entries) {
targetActor.threadActor.removeBreakpoint(location);
}
diff --git a/devtools/server/actors/targets/session-data-processors/event-breakpoints.js b/devtools/server/actors/targets/session-data-processors/event-breakpoints.js
index c0a2fb7ffe..4eb9e4f3a8 100644
--- a/devtools/server/actors/targets/session-data-processors/event-breakpoints.js
+++ b/devtools/server/actors/targets/session-data-processors/event-breakpoints.js
@@ -30,7 +30,7 @@ module.exports = {
}
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry(targetActor, entries) {
targetActor.threadActor.removeEventBreakpoints(entries);
},
};
diff --git a/devtools/server/actors/targets/session-data-processors/resources.js b/devtools/server/actors/targets/session-data-processors/resources.js
index 8f33ba8e0f..1e08397256 100644
--- a/devtools/server/actors/targets/session-data-processors/resources.js
+++ b/devtools/server/actors/targets/session-data-processors/resources.js
@@ -19,7 +19,7 @@ module.exports = {
await Resources.watchResources(targetActor, entries);
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry(targetActor, entries) {
Resources.unwatchResources(targetActor, entries);
},
};
diff --git a/devtools/server/actors/targets/session-data-processors/target-configuration.js b/devtools/server/actors/targets/session-data-processors/target-configuration.js
index f68e82d69f..8f10692178 100644
--- a/devtools/server/actors/targets/session-data-processors/target-configuration.js
+++ b/devtools/server/actors/targets/session-data-processors/target-configuration.js
@@ -5,12 +5,7 @@
"use strict";
module.exports = {
- async addOrSetSessionDataEntry(
- targetActor,
- entries,
- isDocumentCreation,
- updateType
- ) {
+ async addOrSetSessionDataEntry(targetActor, entries, isDocumentCreation) {
// Only WindowGlobalTargetActor implements updateTargetConfiguration,
// skip targetActor data entry update for other targets.
if (typeof targetActor.updateTargetConfiguration == "function") {
@@ -26,7 +21,7 @@ module.exports = {
}
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry() {
// configuration data entries are always added/updated, never removed.
},
};
diff --git a/devtools/server/actors/targets/session-data-processors/thread-configuration.js b/devtools/server/actors/targets/session-data-processors/thread-configuration.js
index 716d2a9b21..ad5c0fe024 100644
--- a/devtools/server/actors/targets/session-data-processors/thread-configuration.js
+++ b/devtools/server/actors/targets/session-data-processors/thread-configuration.js
@@ -7,14 +7,21 @@
const {
STATES: THREAD_STATES,
} = require("resource://devtools/server/actors/thread.js");
+const Targets = require("resource://devtools/server/actors/targets/index.js");
module.exports = {
- async addOrSetSessionDataEntry(
- targetActor,
- entries,
- isDocumentCreation,
- updateType
- ) {
+ async addOrSetSessionDataEntry(targetActor, entries) {
+ // When debugging the whole browser (via the Browser Toolbox), we instantiate both content process and window global (FRAME) targets.
+ // But the debugger will only use the content process target's thread actor.
+ // Thread actor, Sources and Breakpoints have to be only managed for the content process target,
+ // and we should explicitly ignore the window global target.
+ if (
+ targetActor.sessionContext.type == "all" &&
+ targetActor.targetType === Targets.TYPES.FRAME &&
+ targetActor.typeName != "parentProcessTarget"
+ ) {
+ return;
+ }
const threadOptions = {};
for (const { key, value } of entries) {
@@ -35,7 +42,7 @@ module.exports = {
}
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry() {
// configuration data entries are always added/updated, never removed.
},
};
diff --git a/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js b/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js
index 7a0fd815aa..3bbcf54aaf 100644
--- a/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js
+++ b/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js
@@ -36,7 +36,7 @@ module.exports = {
);
},
- removeSessionDataEntry(targetActor, entries, isDocumentCreation) {
+ removeSessionDataEntry(targetActor, entries) {
for (const { path, method } of entries) {
targetActor.threadActor.removeXHRBreakpoint(path, method);
}