Mojo JS bindings: simplify mojo.connectToService() usage - Part 1
This is an incremental step towards the goals listed in crbug.com/419160
The Mojo JS bindings now export an object for each interface. The object itemizes the interface values needed at runtime. Here's an example:
exports.Service = {
name: 'sample::Service',
proxyClass: ServiceProxy,
stubClass: ServiceStub,
validateRequest: validateServiceRequest,
validateResponse: null,
};
I've removed the individual exports of the proxy and stub class names as well as the interface "NAME_" property that was added to proxy and stub classes.
When possible, the object for an interface's client is added. For example:
exports.Service.client = exports.ServiceClient;
The next step (next patch) will automatically create a stub client object that delegates to a user supplied object.
BUG=419160
Review URL: https://codereview.chromium.org/628763002
Cr-Commit-Position: refs/heads/master@{#298509}
20 files changed