Bug 949595 - [devtools] Implement bulk requests in protocol.js. r=devtools-reviewers,nchevobbe

This mimic what was only supported via legacy DevToolsClient.request() method (bug 797639).

Differential Revision: https://phabricator.services.mozilla.com/D245922
This commit is contained in:
Alexandre Poirot
2025-05-15 22:38:02 +00:00
committed by apoirot@mozilla.com
parent 0e8aec0d8b
commit a7b0d37072
11 changed files with 350 additions and 205 deletions

View File

@@ -439,7 +439,8 @@ DevToolsServerConnection.prototype = {
let ret;
if (actor.requestTypes?.[type]) {
try {
ret = actor.requestTypes[type].call(actor, packet);
// Protocol.js Actor.js expects the connection to be passed as second argument.
ret = actor.requestTypes[type].call(actor, packet, this);
} catch (error) {
const prefix = `error occurred while processing bulk packet '${type}'`;
this.transport.send(this._unknownError(actorKey, prefix, error));