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

Unified Diff: third_party/mojo_services/src/public/js/application.js

Issue 904103003: Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: surfaces_service.mojom.h -> surfaces.mojom.h Created 5 years, 10 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: third_party/mojo_services/src/public/js/application.js
diff --git a/third_party/mojo_services/src/public/js/application.js b/third_party/mojo_services/src/public/js/application.js
index d4aa1e674236691fa1643ee8966f42f5fb6ebe2b..aea60fdd36d968d85964bf8731d8c9b1c3257769 100644
--- a/third_party/mojo_services/src/public/js/application.js
+++ b/third_party/mojo_services/src/public/js/application.js
@@ -8,20 +8,19 @@ define("mojo/services/public/js/application", [
"mojo/public/js/connection",
"mojo/public/js/threading",
"mojo/public/interfaces/application/application.mojom",
- "mojo/services/public/js/service_provider",
+ "mojo/services/public/js/service_exchange",
"mojo/services/public/js/shell",
-], function(bindings, core, connection, threading, applicationMojom, serviceProvider, shell) {
+], function(bindings, core, connection, threading, applicationMojom, serviceExchange, shell) {
const ApplicationInterface = applicationMojom.Application;
const ProxyBindings = bindings.ProxyBindings;
- const ServiceProvider = serviceProvider.ServiceProvider;
+ const ServiceExchange = serviceExchange.ServiceExchange;
const Shell = shell.Shell;
class Application {
constructor(appRequestHandle, url) {
this.url = url;
- this.serviceProviders = [];
- this.exposedServiceProviders = [];
+ this.serviceExchanges = [];
this.appRequestHandle_ = appRequestHandle;
this.appStub_ =
connection.bindHandleToStub(appRequestHandle, ApplicationInterface);
@@ -37,30 +36,27 @@ define("mojo/services/public/js/application", [
this.initialize(args);
}
- initialize(args) {}
+ initialize(args) {
+ }
- // The mojom signature of this function is:
- // AcceptConnection(string requestor_url,
- // ServiceProvider&? services,
- // ServiceProvider? exposed_services);
- //
- // We want to bind |services| to our js implementation of ServiceProvider
- // and store |exposed_services| so we can request services of the connecting
- // application.
+ // Implements AcceptConnection() from Application.mojom. Calls
+ // this.acceptConnection() with a JS ServiceExchange instead of a pair
+ // of Mojo ServiceProviders.
doAcceptConnection(requestorUrl, servicesRequest, exposedServicesProxy) {
- // Construct a new js ServiceProvider that can make outgoing calls on
- // exposedServicesProxy.
- var serviceProvider =
- new ServiceProvider(servicesRequest, exposedServicesProxy);
- this.serviceProviders.push(serviceProvider);
- this.acceptConnection(requestorUrl, serviceProvider);
+ var serviceExchange =
+ new ServiceExchange(servicesRequest, exposedServicesProxy);
+ this.serviceExchanges.push(serviceExchange);
+ this.acceptConnection(requestorUrl, serviceExchange);
}
- acceptConnection(requestorUrl, serviceProvider) {}
+ // Subclasses override this method to request or provide services for
+ // ConnectToApplication() calls from requestorURL.
+ acceptConnection(requestorUrl, serviceExchange) {
+ }
quit() {
- this.serviceProviders.forEach(function(sp) {
- sp.close();
+ this.serviceExchanges.forEach(function(exch) {
+ exch.close();
});
this.shell.close();
core.close(this.appRequestHandle_);

Powered by Google App Engine
This is Rietveld 408576698