OLD | NEW |
1 <link rel="import" href="/mojo/public/sky/core.sky" as="core" /> | 1 <import src="/mojo/public/sky/core.sky" as="core" /> |
2 <link rel="import" href="/mojo/public/sky/connection.sky" as="connection" /> | 2 <import src="/mojo/public/sky/connection.sky" as="connection" /> |
3 <script> | 3 <script> |
4 function wrapHandle(handle, service, client) { | 4 function wrapHandle(handle, service, client) { |
5 var clientClass = client && service.client.delegatingStubClass; | 5 var clientClass = client && service.client.delegatingStubClass; |
6 var serviceConnection = new connection.Connection( | 6 var serviceConnection = new connection.Connection( |
7 handle, clientClass, service.proxyClass); | 7 handle, clientClass, service.proxyClass); |
8 if (serviceConnection.local) | 8 if (serviceConnection.local) |
9 serviceConnection.local.delegate$ = client; | 9 serviceConnection.local.delegate$ = client; |
10 serviceConnection.remote.connection$ = serviceConnection; | 10 serviceConnection.remote.connection$ = serviceConnection; |
11 return serviceConnection.remote; | 11 return serviceConnection.remote; |
12 } | 12 } |
13 | 13 |
14 function connectToService(url, service, client) { | 14 function connectToService(url, service, client) { |
15 var handle = internals.connectToService(url, service.name); | 15 var handle = internals.connectToService(url, service.name); |
16 return wrapHandle(handle, service, client); | 16 return wrapHandle(handle, service, client); |
17 } | 17 } |
18 | 18 |
19 module.exports = { | 19 module.exports = { |
20 connectToService: connectToService, | 20 connectToService: connectToService, |
21 wrapHandle: wrapHandle, | 21 wrapHandle: wrapHandle, |
22 }; | 22 }; |
23 </script> | 23 </script> |
OLD | NEW |