diff options
Diffstat (limited to 'devtools/server/actors/resources/thread-states.js')
-rw-r--r-- | devtools/server/actors/resources/thread-states.js | 18 |
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) { |