OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 // Module "content/public/renderer/frame_interfaces" | |
6 // | |
7 // This module provides the JavaScript bindings for | |
8 // services/service_manager/public/cpp/connection.h. | |
9 // Refer to that file for more detailed documentation for equivalent methods. | |
10 | |
11 define("content/public/renderer/frame_interfaces", [ | |
12 "ios/mojo/public/js/sync_message_channel", | |
13 "ios/mojo/public/js/handle_util", | |
14 ], function(syncMessageChannel, handleUtil) { | |
15 | |
16 /** | |
17 * Binds to specified Mojo interface. | |
18 * @param {string} getInterface interface name to connect. | |
19 * @return {!MojoResult} Result code. | |
20 */ | |
21 function getInterface(interfaceName) { | |
22 var nativeHandle = syncMessageChannel.sendMessage({ | |
23 name: "interface_provider.getInterface", | |
24 args: { | |
25 interfaceName: interfaceName | |
26 } | |
27 }); | |
28 return handleUtil.getJavaScriptHandle(nativeHandle); | |
29 } | |
30 | |
31 var exports = {}; | |
32 exports.getInterface = getInterface; | |
33 return exports; | |
34 }); | |
OLD | NEW |