OLD | NEW |
(Empty) | |
| 1 /* Copyright (c) 2012 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 |
| 6 /* From private/ppb_network_monitor_private.idl, |
| 7 * modified Wed Feb 22 18:12:43 2012. |
| 8 */ |
| 9 |
| 10 #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ |
| 11 #define PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ |
| 12 |
| 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" |
| 15 #include "ppapi/c/pp_resource.h" |
| 16 #include "ppapi/c/pp_stdint.h" |
| 17 |
| 18 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 \ |
| 19 "PPB_NetworkMonitor_Private;0.2" |
| 20 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE \ |
| 21 PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 |
| 22 |
| 23 /** |
| 24 * @file |
| 25 * This file defines the <code>PPB_NetworkMonitor_Private</code> interface. |
| 26 */ |
| 27 |
| 28 |
| 29 /** |
| 30 * @addtogroup Typedefs |
| 31 * @{ |
| 32 */ |
| 33 /** |
| 34 * <code>PPB_NetworkMonitor_Callback</code> is a callback function |
| 35 * type that is used to receive notifications about network |
| 36 * configuration changes. The <code>network_list</code> passed to this |
| 37 * callback is a <code>PPB_NetworkList_Private</code> resource that |
| 38 * contains current configuration of network interfaces. |
| 39 */ |
| 40 typedef void (*PPB_NetworkMonitor_Callback)(void* user_data, |
| 41 PP_Resource network_list); |
| 42 /** |
| 43 * @} |
| 44 */ |
| 45 |
| 46 /** |
| 47 * @addtogroup Interfaces |
| 48 * @{ |
| 49 */ |
| 50 /** |
| 51 * The <code>PPB_NetworkMonitor_Private</code> provides access to |
| 52 * notifications of network configuration changes. |
| 53 */ |
| 54 struct PPB_NetworkMonitor_Private_0_2 { |
| 55 /** |
| 56 * Starts network change monitoring. The specified |
| 57 * <code>callback</code> will be called on the main thread once |
| 58 * after this method is called (to supply the initial network |
| 59 * configuarion) and then later every time network configuration |
| 60 * changes. Notifications are stopped when this method is called |
| 61 * with <code>callback</code> set to NULL. |
| 62 * |
| 63 * @param[in] callback The callback that will be called every time |
| 64 * network configuration changes or NULL to stop network monitoring. |
| 65 * |
| 66 * @param[inout] user_data The data to be passed to the callback on |
| 67 * each call. |
| 68 * |
| 69 * @return Returns an error-code in case of an error or PP_OK |
| 70 * otherwise. |
| 71 */ |
| 72 int32_t (*SetCallback)(PP_Instance instance, |
| 73 PPB_NetworkMonitor_Callback callback, |
| 74 void* user_data); |
| 75 }; |
| 76 |
| 77 typedef struct PPB_NetworkMonitor_Private_0_2 PPB_NetworkMonitor_Private; |
| 78 /** |
| 79 * @} |
| 80 */ |
| 81 |
| 82 #endif /* PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ */ |
| 83 |
OLD | NEW |