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

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

Issue 803173009: Mojo JS Bindings: Eliminate foo$ Stub and Proxy class members (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: sync 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/public/js/service_provider.js ('k') | services/js/test/network_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/public/js/shell.js
diff --git a/mojo/services/public/js/shell.js b/mojo/services/public/js/shell.js
index fdec4b1300b8514edb767212df1988ca368f852c..338de5ee58a02c4a5a04cc2bd0ead20b87c40c51 100644
--- a/mojo/services/public/js/shell.js
+++ b/mojo/services/public/js/shell.js
@@ -3,17 +3,21 @@
// found in the LICENSE file.
define("mojo/services/public/js/shell", [
+ "mojo/public/js/bindings",
"mojo/public/js/core",
"mojo/public/js/connection",
"mojo/public/interfaces/application/shell.mojom",
"mojo/public/interfaces/application/service_provider.mojom",
- "mojo/services/public/js/service_provider"
-], function(core,
+ "mojo/services/public/js/service_provider",
+], function(bindings,
+ core,
connection,
shellMojom,
serviceProviderMojom,
serviceProvider) {
+ const ProxyBindings = bindings.ProxyBindings;
+ const StubBindings = bindings.StubBindings;
const ServiceProvider = serviceProvider.ServiceProvider;
const ServiceProviderInterface = serviceProviderMojom.ServiceProvider;
const ShellInterface = shellMojom.Shell;
@@ -23,7 +27,8 @@ define("mojo/services/public/js/shell", [
this.shellHandle = shellHandle;
this.proxy = connection.bindProxyHandle(
shellHandle, ShellInterface.client, ShellInterface);
- this.proxy.local$ = app; // The app is the shell's client.
+
+ ProxyBindings(this.proxy).setLocalDelegate(app);
// TODO: call this serviceProviders_
this.applications_ = new Map();
}
@@ -33,9 +38,9 @@ define("mojo/services/public/js/shell", [
if (application)
return application;
- var returnValue = {};
- this.proxy.connectToApplication(url, returnValue);
- application = new ServiceProvider(returnValue.remote$);
+ this.proxy.connectToApplication(url, function(sp) {
+ application = new ServiceProvider(sp);
+ });
this.applications_.set(url, application);
return application;
}
« no previous file with comments | « mojo/services/public/js/service_provider.js ('k') | services/js/test/network_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698