Hans Muller 0333bd80a7 Mojo JS Bindings: Eliminate foo$ and Stub and Proxy class members
Warning: this change will require Chrome changes. See
https://codereview.chromium.org/803173009/#msg6.

Added ProxyBindings and StubBindings methods that expose
bindings-related properties for generated Proxy and Stub classes
without risking name collisions.

Outgoing "in/out" interface valued parameters are now specified as
functions that are applied to the out value.

Note: the leading capital in the Proxy,StubBindings() methods is
unconventional. It seemed OK given their unusual role: they can be
viewed as transformers from "Foo" objects to "FooBindings" objects.

BUG=
R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/803173009
2015-01-05 12:46:09 -08:00

18 lines
504 B
Plaintext

<import src="/mojo/public/sky/core.sky" as="core" />
<import src="/mojo/public/sky/connection.sky" as="connection" />
<script>
function wrapHandle(handle, service, client) {
return connection.bindProxyHandle(handle, service.client, service);
}
function connectToService(url, service, client) {
var handle = internals.connectToService(url, service.name);
return wrapHandle(handle, service, client);
}
module.exports = {
connectToService: connectToService,
wrapHandle: wrapHandle,
};
</script>