Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1043)

Unified Diff: mojo/services/public/js/service_provider.js

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to adapt to roll Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/services/public/js/service_provider.js
diff --git a/mojo/services/public/js/service_provider.js b/mojo/services/public/js/service_provider.js
index 956658325265353c7c6bcadf70abbf838fddb231..a6a81ca3b9b75f5a900ac5b32fa3bb8341cb69b6 100644
--- a/mojo/services/public/js/service_provider.js
+++ b/mojo/services/public/js/service_provider.js
@@ -18,10 +18,12 @@ define("mojo/services/public/js/service_provider", [
}
class ServiceProvider {
- constructor(service) {
- this.proxy = service;
+ constructor(servicesRequest, exposedServicesProxy) {
+ this.proxy = exposedServicesProxy;
this.providers_ = new Map(); // serviceName => see provideService() below
this.pendingRequests_ = new Map(); // serviceName => serviceHandle
+ if (servicesRequest)
+ StubBindings(servicesRequest).delegate = this;
}
// Incoming requests
@@ -34,11 +36,10 @@ define("mojo/services/public/js/service_provider", [
this.pendingRequests_.set(serviceName, serviceHandle);
return;
}
- var proxy = connection.bindProxyHandle(
- serviceHandle, provider.service, provider.service.client);
- if (ProxyBindings(proxy).local)
- ProxyBindings(proxy).setLocalDelegate(new provider.factory(proxy));
- provider.connections.push(ProxyBindings(proxy).connection);
+
+ var stub = connection.bindHandleToStub(serviceHandle, provider.service);
+ StubBindings(stub).delegate = new provider.factory();
+ provider.connections.push(StubBindings(stub).connection);
}
provideService(service, factory) {
@@ -66,12 +67,11 @@ define("mojo/services/public/js/service_provider", [
if (!clientImpl && interfaceObject.client)
throw new Error("Client implementation must be provided");
- var remoteProxy;
- var clientFactory = function(x) {remoteProxy = x; return clientImpl;};
- var messagePipeHandle = connection.bindProxyClient(
- clientFactory, interfaceObject.client, interfaceObject);
- this.proxy.connectToService(interfaceObject.name, messagePipeHandle);
- return remoteProxy;
+ var serviceProxy;
+ var serviceHandle = connection.bindProxy(
+ function(sp) {serviceProxy = sp;}, interfaceObject);
+ this.proxy.connectToService(interfaceObject.name, serviceHandle);
+ return serviceProxy;
};
close() {

Powered by Google App Engine
This is Rietveld 408576698