diff options
Diffstat (limited to 'devtools/server/actors/targets/session-data-processors')
5 files changed, 10 insertions, 20 deletions
diff --git a/devtools/server/actors/targets/session-data-processors/breakpoints.js b/devtools/server/actors/targets/session-data-processors/breakpoints.js index 67c270654d..8ecd80ad64 100644 --- a/devtools/server/actors/targets/session-data-processors/breakpoints.js +++ b/devtools/server/actors/targets/session-data-processors/breakpoints.js @@ -32,11 +32,9 @@ module.exports = { threadActor.removeAllBreakpoints(); } const isTargetCreation = threadActor.state == THREAD_STATES.DETACHED; - if (isTargetCreation && !targetActor.targetType.endsWith("worker")) { + if (isTargetCreation) { // If addOrSetSessionDataEntry is called during target creation, attach the // thread actor automatically and pass the initial breakpoints. - // However, do not attach the thread actor for Workers. They use a codepath - // which releases the worker on `attach`. For them, the client will call `attach`. (bug 1691986) await threadActor.attach({ breakpoints: entries }); } else { // If addOrSetSessionDataEntry is called for an existing target, set the new 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 4eb9e4f3a8..1b2dbd847e 100644 --- a/devtools/server/actors/targets/session-data-processors/event-breakpoints.js +++ b/devtools/server/actors/targets/session-data-processors/event-breakpoints.js @@ -16,11 +16,8 @@ module.exports = { updateType ) { const { threadActor } = targetActor; - // Same as comments for XHR breakpoints. See lines 117-118 - if ( - threadActor.state == THREAD_STATES.DETACHED && - !targetActor.targetType.endsWith("worker") - ) { + // The thread actor has to be initialized in order to have functional breakpoints + if (threadActor.state == THREAD_STATES.DETACHED) { threadActor.attach(); } if (updateType == "set") { diff --git a/devtools/server/actors/targets/session-data-processors/index.js b/devtools/server/actors/targets/session-data-processors/index.js index 19b7d69302..72bc769dd1 100644 --- a/devtools/server/actors/targets/session-data-processors/index.js +++ b/devtools/server/actors/targets/session-data-processors/index.js @@ -4,9 +4,10 @@ "use strict"; -const { - SessionDataHelpers, -} = require("resource://devtools/server/actors/watcher/SessionDataHelpers.jsm"); +const { SessionDataHelpers } = ChromeUtils.importESModule( + "resource://devtools/server/actors/watcher/SessionDataHelpers.sys.mjs", + { global: "contextual" } +); const { SUPPORTED_DATA } = SessionDataHelpers; const SessionDataProcessors = {}; 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 ad5c0fe024..381a62f640 100644 --- a/devtools/server/actors/targets/session-data-processors/thread-configuration.js +++ b/devtools/server/actors/targets/session-data-processors/thread-configuration.js @@ -28,12 +28,9 @@ module.exports = { threadOptions[key] = value; } - if ( - !targetActor.targetType.endsWith("worker") && - targetActor.threadActor.state == THREAD_STATES.DETACHED - ) { + if (targetActor.threadActor.state == THREAD_STATES.DETACHED) { await targetActor.threadActor.attach(threadOptions); - } else { + } else if (!targetActor.threadActor.isDestroyed()) { // Regarding `updateType`, `entries` is always a partial set of configurations. // We will acknowledge the passed attribute, but if we had set some other attributes // before this call, they will stay as-is. 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 3bbcf54aaf..81ecb72fb2 100644 --- a/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js +++ b/devtools/server/actors/targets/session-data-processors/xhr-breakpoints.js @@ -22,10 +22,7 @@ module.exports = { // The thread actor has to be initialized in order to correctly // retrieve the stack trace when hitting an XHR - if ( - threadActor.state == THREAD_STATES.DETACHED && - !targetActor.targetType.endsWith("worker") - ) { + if (threadActor.state == THREAD_STATES.DETACHED) { await threadActor.attach(); } |