summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors/resources/thread-states.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /devtools/server/actors/resources/thread-states.js
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/server/actors/resources/thread-states.js')
-rw-r--r--devtools/server/actors/resources/thread-states.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/devtools/server/actors/resources/thread-states.js b/devtools/server/actors/resources/thread-states.js
index 9ac79088d2..11aef81734 100644
--- a/devtools/server/actors/resources/thread-states.js
+++ b/devtools/server/actors/resources/thread-states.js
@@ -7,6 +7,7 @@
const {
TYPES: { THREAD_STATE },
} = require("resource://devtools/server/actors/resources/index.js");
+const Targets = require("resource://devtools/server/actors/targets/index.js");
const {
PAUSE_REASONS,
@@ -48,6 +49,18 @@ class BreakpointWatcher {
* This will be called for each resource.
*/
async watch(targetActor, { onAvailable }) {
+ // 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;
this.threadActor = threadActor;
this.onAvailable = onAvailable;
@@ -87,6 +100,9 @@ class BreakpointWatcher {
* Stop watching for breakpoints
*/
destroy() {
+ if (!this.threadActor) {
+ return;
+ }
this.threadActor.off("paused", this.onPaused);
this.threadActor.off("resumed", this.onResumed);
}
@@ -116,7 +132,7 @@ class BreakpointWatcher {
]);
}
- onResumed(packet) {
+ onResumed() {
// NOTE: resumed events are suppressed while interrupted
// to prevent unintentional behavior.
if (this.isInterrupted) {