blob: 1f14964ec000f3817625a263c89007e57268a31c [file] [log] [blame]
#!mojo:js_content_handler
define("main", [
"mojo/services/public/js/application",
"services/js/test/pingpong_service.mojom",
], function(application, pingPongServiceMojom) {
const Application = application.Application;
const PingPongService = pingPongServiceMojom.PingPongService;
class PingPongServiceImpl {
constructor(app, client) {
this.app = app;
this.client = client;
}
ping(value) {
this.client.pong(value + 1);
}
quit() {
this.app.quit();
}
}
class PingPongTarget extends Application {
acceptConnection(url, serviceProvider) {
serviceProvider.provideService(
PingPongService, PingPongServiceImpl.bind(null, this));
}
}
return PingPongTarget;
});