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

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

Issue 883843002: Update mojo sdk to rev 126532ce21c5c3c55a1e1693731411cb60169efd (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review 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
« no previous file with comments | « mojo/services/navigation/public/interfaces/BUILD.gn ('k') | mojo/services/public/js/service_provider.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/js/application.js
diff --git a/mojo/services/public/js/application.js b/mojo/services/public/js/application.js
index ed41628ae3a34153a2f584c122706d07ac666589..d4aa1e674236691fa1643ee8966f42f5fb6ebe2b 100644
--- a/mojo/services/public/js/application.js
+++ b/mojo/services/public/js/application.js
@@ -4,30 +4,41 @@
define("mojo/services/public/js/application", [
"mojo/public/js/bindings",
+ "mojo/public/js/core",
+ "mojo/public/js/connection",
"mojo/public/js/threading",
+ "mojo/public/interfaces/application/application.mojom",
"mojo/services/public/js/service_provider",
"mojo/services/public/js/shell",
-], function(bindings, threading, serviceProvider, shell) {
+], function(bindings, core, connection, threading, applicationMojom, serviceProvider, shell) {
+ const ApplicationInterface = applicationMojom.Application;
const ProxyBindings = bindings.ProxyBindings;
const ServiceProvider = serviceProvider.ServiceProvider;
const Shell = shell.Shell;
class Application {
- constructor(shellHandle, url) {
+ constructor(appRequestHandle, url) {
this.url = url;
this.serviceProviders = [];
this.exposedServiceProviders = [];
- this.shellHandle_ = shellHandle;
- this.shell = new Shell(shellHandle, {
- initialize: this.initialize.bind(this),
- acceptConnection: this.doAcceptConnection.bind(this),
- });
+ this.appRequestHandle_ = appRequestHandle;
+ this.appStub_ =
+ connection.bindHandleToStub(appRequestHandle, ApplicationInterface);
+ bindings.StubBindings(this.appStub_).delegate = {
+ initialize: this.doInitialize.bind(this),
+ acceptConnection: this.doAcceptConnection.bind(this),
+ };
}
- initialize(args) {
+ doInitialize(shellProxy, args) {
+ this.shellProxy_ = shellProxy;
+ this.shell = new Shell(shellProxy);
+ this.initialize(args);
}
+ initialize(args) {}
+
// The mojom signature of this function is:
// AcceptConnection(string requestor_url,
// ServiceProvider&? services,
@@ -39,23 +50,20 @@ define("mojo/services/public/js/application", [
doAcceptConnection(requestorUrl, servicesRequest, exposedServicesProxy) {
// Construct a new js ServiceProvider that can make outgoing calls on
// exposedServicesProxy.
- var serviceProvider = new ServiceProvider(exposedServicesProxy);
+ var serviceProvider =
+ new ServiceProvider(servicesRequest, exposedServicesProxy);
this.serviceProviders.push(serviceProvider);
-
- // Then associate incoming calls with the serviceProvider.
- ProxyBindings(servicesRequest).setLocalDelegate(serviceProvider);
-
this.acceptConnection(requestorUrl, serviceProvider);
}
- acceptConnection(requestorUrl, serviceProvider) {
- }
+ acceptConnection(requestorUrl, serviceProvider) {}
quit() {
this.serviceProviders.forEach(function(sp) {
sp.close();
});
this.shell.close();
+ core.close(this.appRequestHandle_);
threading.quit();
}
}
« no previous file with comments | « mojo/services/navigation/public/interfaces/BUILD.gn ('k') | mojo/services/public/js/service_provider.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698