forked from mirrors/gecko-dev
MozReview-Commit-ID: BFaOv5i5Tun --HG-- extra : rebase_source : 5c2b5d1867eb5b48c56725b87d71dae72a83eb34
28 lines
625 B
JavaScript
28 lines
625 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
/* exported HelloActor */
|
|
"use strict";
|
|
|
|
const protocol = require("devtools/shared/protocol");
|
|
|
|
const helloSpec = protocol.generateActorSpec({
|
|
typeName: "helloActor",
|
|
|
|
methods: {
|
|
count: {
|
|
request: {},
|
|
response: {count: protocol.RetVal("number")}
|
|
}
|
|
}
|
|
});
|
|
|
|
var HelloActor = protocol.ActorClassWithSpec(helloSpec, {
|
|
initialize: function () {
|
|
protocol.Actor.prototype.initialize.apply(this, arguments);
|
|
this.counter = 0;
|
|
},
|
|
|
|
count: function () {
|
|
return ++this.counter;
|
|
}
|
|
});
|