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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 define("mojo/services/public/js/shell", [
6 "mojo/public/interfaces/application/service_provider.mojom",
7 "mojo/services/public/js/service_provider",
8 ], function(spInterfaceModule, spModule) {
9
10 class Shell {
11 constructor(appShell) {
12 this.appShell_ = appShell;
13 this.applications_ = new Map();
14 }
15
16 connectToApplication(url) {
17 var application = this.applications_.get(url);
18 if (application)
19 return application;
20
21 var proxy = new spInterfaceModule.ServiceProvider.proxyClass;
22 this.appShell_.connectToApplication(url, proxy);
23 application = new spModule.ServiceProvider(proxy);
24 this.applications_.set(url, application);
25 return application;
26 }
27
28 connectToService(url, service, client) {
29 return this.connectToApplication(url).connectToService(service, client);
30 };
31
32 close() {
33 this.applications_.forEach(function(application, url) {
34 application.close();
35 });
36 this.applications_.clear();
37 }
38 }
39
40 var exports = {};
41 exports.Shell = Shell;
42 return exports;
43 });
OLDNEW
« 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