mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Upgrade Sky's use of the JS bindings
BUG= R=abarth@chromium.org Review URL: https://codereview.chromium.org/875713003
This commit is contained in:
parent
7f9d02fc75
commit
acdacb9214
@ -1,8 +1,8 @@
|
||||
<import src="shell.sky" as="shell" />
|
||||
<import src="/gen/mojo/public/sky/connection.sky" as="connection" />
|
||||
<script>
|
||||
function connectToEmbedderService(service, client) {
|
||||
var handle = internals.connectToEmbedderService(service.name);
|
||||
return shell.wrapHandle(handle, service, client);
|
||||
function connectToEmbedderService(service) {
|
||||
var handle = internals.connectToEmbedderService(service.name);
|
||||
return connection.bindHandleToProxy(handle, service);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
@ -1,17 +1,11 @@
|
||||
<import src="/gen/mojo/public/sky/core.sky" as="core" />
|
||||
<import src="/gen/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);
|
||||
return connection.bindHandleToProxy(handle, service);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
connectToService: connectToService,
|
||||
wrapHandle: wrapHandle,
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -101,10 +101,9 @@ class XMLHttpRequest {
|
||||
});
|
||||
priv.request.headers = requestHeaders;
|
||||
|
||||
// FIXME: Factor this into the JS bindings.
|
||||
var pipe = new core.createMessagePipe();
|
||||
priv.networkService.createURLLoader(pipe.handle1);
|
||||
priv.loader = shell.wrapHandle(pipe.handle0, loader.URLLoader);
|
||||
priv.networkService.createURLLoader(function(urlLoaderProxy) {
|
||||
priv.loader = urlLoaderProxy;
|
||||
});
|
||||
|
||||
var self = this;
|
||||
outstandingRequests.add(this);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user