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

Side by Side Diff: mojo/services/public/js/service_provider.js

Issue 837283002: Mojo JS Bindings: merge Application, Shell, ServiceProvider with Sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Commit missing file 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 define("mojo/services/public/js/service_provider", [ 5 define("mojo/services/public/js/service_provider", [
6 "mojo/public/js/bindings", 6 "mojo/public/js/bindings",
7 "mojo/public/interfaces/application/service_provider.mojom", 7 "mojo/public/interfaces/application/service_provider.mojom",
8 "mojo/public/js/connection", 8 "mojo/public/js/connection",
9 ], function(bindings, serviceProviderMojom, connection) { 9 ], function(bindings, spMojom, connection) {
10 10
11 const ProxyBindings = bindings.ProxyBindings; 11 const ProxyBindings = bindings.ProxyBindings;
12 const StubBindings = bindings.StubBindings; 12 const StubBindings = bindings.StubBindings;
13 const ServiceProviderInterface = serviceProviderMojom.ServiceProvider; 13 const ServiceProviderInterface = spMojom.ServiceProvider;
14 14
15 function checkServiceProvider(sp) { 15 function checkServiceProvider(sp) {
16 if (!sp.providers_) 16 if (!sp.providers_)
17 throw new Error("Service was closed"); 17 throw new Error("Service was closed");
18 } 18 }
19 19
20 class ServiceProvider { 20 class ServiceProvider {
21 constructor(service) { 21 constructor(service) {
22 if (!(service instanceof ServiceProviderInterface.proxyClass)) 22 if (!(service instanceof ServiceProviderInterface.proxyClass))
23 throw new Error("service must be a ServiceProvider proxy"); 23 throw new Error("service must be a ServiceProvider proxy");
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 close() { 80 close() {
81 this.providers_ = null; 81 this.providers_ = null;
82 this.pendingRequests_ = null; 82 this.pendingRequests_ = null;
83 } 83 }
84 } 84 }
85 85
86 var exports = {}; 86 var exports = {};
87 exports.ServiceProvider = ServiceProvider; 87 exports.ServiceProvider = ServiceProvider;
88 return exports; 88 return exports;
89 }); 89 });
OLDNEW
« no previous file with comments | « mojo/services/BUILD.gn ('k') | mojo/services/public/js/shell.js » ('j') | sky/tools/skydb » ('J')

Powered by Google App Engine
This is Rietveld 408576698