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

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

Issue 877993004: Revert "Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 aea60fdd36d968d85964bf8731d8c9b1c3257769..d4aa1e674236691fa1643ee8966f42f5fb6ebe2b 100644
--- a/third_party/mojo_services/src/public/js/application.js
+++ b/third_party/mojo_services/src/public/js/application.js
@@ -8,19 +8,20 @@ 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_exchange",
+ "mojo/services/public/js/service_provider",
"mojo/services/public/js/shell",
-], function(bindings, core, connection, threading, applicationMojom, serviceExchange, shell) {
+], function(bindings, core, connection, threading, applicationMojom, serviceProvider, shell) {
const ApplicationInterface = applicationMojom.Application;
const ProxyBindings = bindings.ProxyBindings;
- const ServiceExchange = serviceExchange.ServiceExchange;
+ const ServiceProvider = serviceProvider.ServiceProvider;
const Shell = shell.Shell;
class Application {
constructor(appRequestHandle, url) {
this.url = url;
- this.serviceExchanges = [];
+ this.serviceProviders = [];
+ this.exposedServiceProviders = [];
this.appRequestHandle_ = appRequestHandle;
this.appStub_ =
connection.bindHandleToStub(appRequestHandle, ApplicationInterface);
@@ -36,27 +37,30 @@ define("mojo/services/public/js/application", [
this.initialize(args);
}
- initialize(args) {
- }
+ initialize(args) {}
- // Implements AcceptConnection() from Application.mojom. Calls
- // this.acceptConnection() with a JS ServiceExchange instead of a pair
- // of Mojo ServiceProviders.
+ // 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.
doAcceptConnection(requestorUrl, servicesRequest, exposedServicesProxy) {
- var serviceExchange =
- new ServiceExchange(servicesRequest, exposedServicesProxy);
- this.serviceExchanges.push(serviceExchange);
- this.acceptConnection(requestorUrl, serviceExchange);
+ // 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);
}
- // Subclasses override this method to request or provide services for
- // ConnectToApplication() calls from requestorURL.
- acceptConnection(requestorUrl, serviceExchange) {
- }
+ acceptConnection(requestorUrl, serviceProvider) {}
quit() {
- this.serviceExchanges.forEach(function(exch) {
- exch.close();
+ this.serviceProviders.forEach(function(sp) {
+ sp.close();
});
this.shell.close();
core.close(this.appRequestHandle_);

Powered by Google App Engine
This is Rietveld 408576698