Index: sky/framework/shell.sky |
diff --git a/sky/framework/shell.sky b/sky/framework/shell.sky |
new file mode 100644 |
index 0000000000000000000000000000000000000000..de45b7e35f41a0e9388ffc885839a9746a4301b3 |
--- /dev/null |
+++ b/sky/framework/shell.sky |
@@ -0,0 +1,23 @@ |
+<link rel="import" href="/mojo/public/html/core.html" as="core" /> |
+<link rel="import" href="/mojo/public/html/connection.html" 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); |
+} |
+ |
+this.exports = { |
+ connectToService: connectToService, |
+ wrapHandle: wrapHandle, |
+}; |
+</script> |