OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 /* From private/ppb_network_monitor_private.idl, | 6 /* From ppb_network_monitor.idl modified Thu Aug 29 16:26:45 2013. */ |
7 * modified Thu Mar 28 10:30:11 2013. | |
8 */ | |
9 | 7 |
10 #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ | 8 #ifndef PPAPI_C_PPB_NETWORK_MONITOR_H_ |
11 #define PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ | 9 #define PPAPI_C_PPB_NETWORK_MONITOR_H_ |
12 | 10 |
13 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
14 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
17 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
18 | 16 |
19 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 \ | 17 #define PPB_NETWORKMONITOR_INTERFACE_1_0 "PPB_NetworkMonitor;1.0" |
20 "PPB_NetworkMonitor_Private;0.2" | 18 #define PPB_NETWORKMONITOR_INTERFACE PPB_NETWORKMONITOR_INTERFACE_1_0 |
21 #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE \ | |
22 PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 | |
23 | 19 |
24 /** | 20 /** |
25 * @file | 21 * @file |
26 * This file defines the <code>PPB_NetworkMonitor_Private</code> interface. | 22 * This file defines the <code>PPB_NetworkMonitor</code> interface. |
27 */ | 23 */ |
28 | 24 |
29 | 25 |
30 /** | 26 /** |
31 * @addtogroup Typedefs | 27 * @addtogroup Typedefs |
32 * @{ | 28 * @{ |
33 */ | 29 */ |
34 /** | 30 /** |
35 * <code>PPB_NetworkMonitor_Callback</code> is a callback function | 31 * <code>PPB_NetworkMonitor_Callback</code> is a callback function |
36 * type that is used to receive notifications about network | 32 * type that is used to receive notifications about network |
37 * configuration changes. The <code>network_list</code> passed to this | 33 * configuration changes. The <code>network_list</code> passed to this |
38 * callback is a <code>PPB_NetworkList_Private</code> resource that | 34 * callback is a <code>PPB_NetworkList</code> resource that contains |
39 * contains current configuration of network interfaces. | 35 * current configuration of network interfaces. |
40 */ | 36 */ |
41 typedef void (*PPB_NetworkMonitor_Callback)(void* user_data, | 37 typedef void (*PPB_NetworkMonitor_Callback)(void* user_data, |
42 PP_Resource network_list); | 38 PP_Resource network_list); |
43 /** | 39 /** |
44 * @} | 40 * @} |
45 */ | 41 */ |
46 | 42 |
47 /** | 43 /** |
48 * @addtogroup Interfaces | 44 * @addtogroup Interfaces |
49 * @{ | 45 * @{ |
50 */ | 46 */ |
51 /** | 47 /** |
52 * The <code>PPB_NetworkMonitor_Private</code> provides access to | 48 * The <code>PPB_NetworkMonitor</code> provides access to |
53 * notifications of network configuration changes. | 49 * notifications of network configuration changes. |
54 */ | 50 */ |
55 struct PPB_NetworkMonitor_Private_0_2 { | 51 struct PPB_NetworkMonitor_1_0 { |
56 /** | 52 /** |
57 * Starts network change monitoring. The specified | 53 * Starts network change monitoring. The specified |
58 * <code>callback</code> will be called on the main thread once | 54 * <code>callback</code> will be called on the main thread once |
59 * after this method is called (to supply the initial network | 55 * after this method is called (to supply the initial network |
60 * configuration) and then later every time network configuration | 56 * configuration) and then later every time network configuration |
61 * changes. Notifications are stopped when the returned resource is | 57 * changes. Notifications are stopped when the returned resource is |
62 * destroyed. If the plugin doesn't have access to the network list | 58 * destroyed. If the plugin doesn't have access to the network list |
63 * then the callback will be called once with the | 59 * then the callback will be called once with the |
64 * <code>network_list</code> parameter is set to 0. | 60 * <code>network_list</code> parameter is set to 0. |
65 * | 61 * |
66 * @param[in] callback The callback that will be called every time | 62 * @param[in] callback The callback that will be called every time |
67 * network configuration changes or NULL to stop network monitoring. | 63 * network configuration changes or NULL to stop network monitoring. |
68 * | 64 * |
69 * @param[inout] user_data The data to be passed to the callback on | 65 * @param[inout] user_data The data to be passed to the callback on |
70 * each call. | 66 * each call. |
71 * | 67 * |
72 * @return A <code>PP_Resource</code> containing the created | 68 * @return A <code>PP_Resource</code> containing the created |
73 * NetworkMonitor resource. | 69 * NetworkMonitor resource. |
74 */ | 70 */ |
75 PP_Resource (*Create)(PP_Instance instance, | 71 PP_Resource (*Create)(PP_Instance instance, |
76 PPB_NetworkMonitor_Callback callback, | 72 PPB_NetworkMonitor_Callback callback, |
77 void* user_data); | 73 void* user_data); |
78 /** | 74 /** |
79 * Determines if the specified <code>resource</code> is a | 75 * Determines if the specified <code>resource</code> is a |
80 * <code>NetworkMonitor</code> object. | 76 * <code>NetworkMonitor</code> object. |
81 * | 77 * |
82 * @param[in] resource A <code>PP_Resource</code> resource. | 78 * @param[in] resource A <code>PP_Resource</code> resource. |
83 * | 79 * |
84 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is | 80 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is |
85 * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code> | 81 * a <code>PPB_NetworkMonitor</code>, <code>PP_FALSE</code> |
86 * otherwise. | 82 * otherwise. |
87 */ | 83 */ |
88 PP_Bool (*IsNetworkMonitor)(PP_Resource resource); | 84 PP_Bool (*IsNetworkMonitor)(PP_Resource resource); |
89 }; | 85 }; |
90 | 86 |
91 typedef struct PPB_NetworkMonitor_Private_0_2 PPB_NetworkMonitor_Private; | 87 typedef struct PPB_NetworkMonitor_1_0 PPB_NetworkMonitor; |
92 /** | 88 /** |
93 * @} | 89 * @} |
94 */ | 90 */ |
95 | 91 |
96 #endif /* PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_ */ | 92 #endif /* PPAPI_C_PPB_NETWORK_MONITOR_H_ */ |
97 | 93 |
OLD | NEW |