OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * Custom bindings for the mojoPrivate API. | 6 * Custom bindings for the mojoPrivate API. |
7 */ | 7 */ |
8 | 8 |
9 let binding = require('binding').Binding.create('mojoPrivate'); | 9 let binding = require('binding').Binding.create('mojoPrivate'); |
10 | 10 |
11 binding.registerCustomHook(function(bindingsAPI) { | 11 binding.registerCustomHook(function(bindingsAPI) { |
12 let apiFunctions = bindingsAPI.apiFunctions; | 12 let apiFunctions = bindingsAPI.apiFunctions; |
13 | 13 |
14 apiFunctions.setHandleRequest('define', function(name, deps, factory) { | 14 apiFunctions.setHandleRequest('define', function(name, deps, factory) { |
15 define(name, deps || [], factory); | 15 define(name, deps || [], factory); |
16 }); | 16 }); |
17 | 17 |
18 apiFunctions.setHandleRequest('requireAsync', function(moduleName) { | 18 apiFunctions.setHandleRequest('requireAsync', function(moduleName) { |
19 return requireAsync(moduleName); | 19 return requireAsync(moduleName); |
20 }); | 20 }); |
21 }); | 21 }); |
22 | 22 |
23 exports.binding = binding.generate(); | 23 exports.$set('binding', binding.generate()); |
OLD | NEW |