Adam Barth 03114dfa7e Switch "html" Mojo modules to the Sky module system
These never really worked with HTML imports. This CL updates them to use a more
modern version of the Sky module system so we can delete the old this.exports
pattern.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/697723003
2014-10-31 14:46:40 -07:00

24 lines
801 B
Plaintext

<link rel="import" href="/mojo/public/sky/core.sky" as="core" />
<link rel="import" href="/mojo/public/sky/connection.sky" as="connection" />
<script>
function wrapHandle(handle, service, client) {
var clientClass = client && service.client.delegatingStubClass;
var serviceConnection = new connection.Connection(
handle, clientClass, service.proxyClass);
if (serviceConnection.local)
serviceConnection.local.delegate$ = client;
serviceConnection.remote.connection$ = serviceConnection;
return serviceConnection.remote;
}
function connectToService(url, service, client) {
var handle = internals.connectToService(url, service.name);
return wrapHandle(handle, service, client);
}
module.exports = {
connectToService: connectToService,
wrapHandle: wrapHandle,
};
</script>