summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors/thread.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/server/actors/thread.js')
-rw-r--r--devtools/server/actors/thread.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/devtools/server/actors/thread.js b/devtools/server/actors/thread.js
index 07dcc27a6a..0042e76a2a 100644
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -418,12 +418,6 @@ class ThreadActor extends Actor {
this.alreadyAttached = true;
this.dbg.enable();
- // Notify the target actor that we've finished attaching. If this is a worker
- // thread which was paused until attaching, this will allow content to
- // begin executing.
- if (this.targetActor.onThreadAttached) {
- this.targetActor.onThreadAttached();
- }
if (Services.obs) {
// Set a wrappedJSObject property so |this| can be sent via the observer service
// for the xpcshell harness.
@@ -535,6 +529,13 @@ class ThreadActor extends Actor {
}
async setBreakpoint(location, options) {
+ // Automatically initialize the thread actor if it wasn't yet done.
+ // Note that ideally, it should rather be done via reconfigure/thread configuration.
+ if (this._state === STATES.DETACHED) {
+ this.attach({});
+ this.addAllSources();
+ }
+
let actor = this.breakpointActorMap.get(location);
// Avoid resetting the exact same breakpoint twice
if (actor && JSON.stringify(actor.options) == JSON.stringify(options)) {
@@ -597,7 +598,9 @@ class ThreadActor extends Actor {
}
getAvailableEventBreakpoints() {
- return getAvailableEventBreakpoints(this.targetActor.window);
+ return getAvailableEventBreakpoints(
+ this.targetActor.window || this.targetActor.workerGlobal
+ );
}
getActiveEventBreakpoints() {
return Array.from(this._activeEventBreakpoints);