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

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

Issue 782693004: Update mojo sdk to rev f6c8ec07c01deebc13178d516225fd12695c3dc2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hack mojo_system_impl gypi for android :| Created 6 years 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/shell.js
diff --git a/mojo/services/public/js/shell.js b/mojo/services/public/js/shell.js
new file mode 100644
index 0000000000000000000000000000000000000000..82d52929f16633402f269fdd9ec4135aed1fe914
--- /dev/null
+++ b/mojo/services/public/js/shell.js
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+define("mojo/services/public/js/shell", [
+ "mojo/public/interfaces/application/service_provider.mojom",
+ "mojo/services/public/js/service_provider",
+], function(spInterfaceModule, spModule) {
+
+ class Shell {
+ constructor(appShell) {
+ this.appShell_ = appShell;
+ this.applications_ = new Map();
+ }
+
+ connectToApplication(url) {
+ var application = this.applications_.get(url);
+ if (application)
+ return application;
+
+ var proxy = new spInterfaceModule.ServiceProvider.proxyClass;
+ this.appShell_.connectToApplication(url, proxy);
+ application = new spModule.ServiceProvider(proxy);
+ this.applications_.set(url, application);
+ return application;
+ }
+
+ connectToService(url, service, client) {
+ return this.connectToApplication(url).connectToService(service, client);
+ };
+
+ close() {
+ this.applications_.forEach(function(application, url) {
+ application.close();
+ });
+ this.applications_.clear();
+ }
+ }
+
+ var exports = {};
+ exports.Shell = Shell;
+ return exports;
+});
« mojo/edk/mojo_edk_system_impl.gypi ('K') | « mojo/services/public/js/service_provider.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698