mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Some actors weren't using any specification. They now have to pass a bare minimal spec object. Unifying them to the regular Actor interface helps merging constructor with initialize and instantiate all the actors without any code branch. Differential Revision: https://phabricator.services.mozilla.com/D169359
28 lines
569 B
JavaScript
28 lines
569 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
const { Actor } = require("resource://devtools/shared/protocol/Actor.js");
|
|
|
|
class TestActor1 extends Actor {
|
|
constructor(conn, tab) {
|
|
super(conn, { typeName: "testOne", methods: [] });
|
|
this.tab = tab;
|
|
|
|
this.requestTypes = {
|
|
ping: TestActor1.prototype.onPing,
|
|
};
|
|
}
|
|
|
|
grip() {
|
|
return { actor: this.actorID, test: "TestActor1" };
|
|
}
|
|
|
|
onPing() {
|
|
return { pong: "pong" };
|
|
}
|
|
}
|
|
|
|
exports.TestActor1 = TestActor1;
|