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