| 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 |
| 18 apiFunctions.setHandleRequest('requireAsync', function(moduleName) { |
| 19 return requireAsync(moduleName); |
| 20 }); |
| 17 }); | 21 }); |
| 18 | 22 |
| 19 exports.binding = binding.generate(); | 23 exports.binding = binding.generate(); |
| OLD | NEW |