Bug 1740292 - [devtools] Remove target actor's attach method entirely. r=nchevobbe,devtools-backward-compat-reviewers

(except for the special edgecase of worker's hybrid descriptor/target)

Differential Revision: https://phabricator.services.mozilla.com/D130914
This commit is contained in:
Alexandre Poirot 2021-11-18 10:57:01 +00:00
Родитель 487d9677f3
Коммит 841b8e961c
2 изменённых файлов: 2 добавлений и 29 удалений

Просмотреть файл

@ -141,13 +141,8 @@ const windowGlobalTargetPrototype = {
*
* ### Main requests:
*
* `attach`/`detach` requests:
* - start/stop document watching:
* Starts watching for new documents and emits `tabNavigated` and
* `frameUpdate` over RDP.
* - retrieve the thread actor:
* Instantiates a ThreadActor that can be later attached to in order to
* debug JS sources in the document.
* `detach`:
* Stop document watching and cleanup everything that the target and its children actors created.
* `switchToFrame`:
* Change the targeted document of the whole actor, and its child target-scoped actors
* to an iframe or back to its original document.
@ -1152,18 +1147,6 @@ const windowGlobalTargetPrototype = {
// Protocol Request Handlers
attach(request) {
if (this.isDestroyed()) {
throw {
error: "destroyed",
};
}
return {
threadActor: this.threadActor.actorID,
};
},
detach(request) {
if (!this._detach()) {
throw {

Просмотреть файл

@ -154,7 +154,6 @@ const TestTargetActor = protocol.ActorClassWithSpec(windowGlobalTargetSpec, {
this._global.wrappedJSObject = global;
this.threadActor = new ThreadActor(this, this._global);
this.conn.addActor(this.threadActor);
this._attached = false;
this._extraActors = {};
// This is a hack in order to enable threadActor to be accessed from getFront
this._extraActors.threadActor = this.threadActor;
@ -210,16 +209,7 @@ const TestTargetActor = protocol.ActorClassWithSpec(windowGlobalTargetSpec, {
return { ...response, ...actors };
},
attach: function(request) {
this._attached = true;
return { threadActor: this.threadActor.actorID };
},
detach: function(request) {
if (!this._attached) {
return { error: "wrongState" };
}
this.threadActor.destroy();
return { type: "detached" };
},