Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / extensions / renderer / resources / mojo_private_custom_bindings.js
blobf898c0766adc61b30458371f4a555a74bdfc5154
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
3 // found in the LICENSE file.
5 /**
6  * Custom bindings for the mojoPrivate API.
7  */
9 let binding = require('binding').Binding.create('mojoPrivate');
11 binding.registerCustomHook(function(bindingsAPI) {
12   let apiFunctions = bindingsAPI.apiFunctions;
14   apiFunctions.setHandleRequest('define', function(name, deps, factory) {
15     define(name, deps || [], factory);
16   });
18   apiFunctions.setHandleRequest('requireAsync', function(moduleName) {
19     return requireAsync(moduleName);
20   });
21 });
23 exports.binding = binding.generate();