| Index: ppapi/c/private/ppb_network_monitor_private.h
|
| diff --git a/ppapi/c/private/ppb_network_monitor_private.h b/ppapi/c/private/ppb_network_monitor_private.h
|
| index 93c1ff03bd190bc0a26045210a5c534f2426b2bc..e8a8c3a2e0bc96f8a04c8416a46917b69e384199 100644
|
| --- a/ppapi/c/private/ppb_network_monitor_private.h
|
| +++ b/ppapi/c/private/ppb_network_monitor_private.h
|
| @@ -4,22 +4,23 @@
|
| */
|
|
|
| /* From private/ppb_network_monitor_private.idl,
|
| - * modified Thu Mar 28 10:30:11 2013.
|
| + * modified Tue Sep 3 11:00:18 2013.
|
| */
|
|
|
| #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_
|
| #define PPAPI_C_PRIVATE_PPB_NETWORK_MONITOR_PRIVATE_H_
|
|
|
| #include "ppapi/c/pp_bool.h"
|
| +#include "ppapi/c/pp_completion_callback.h"
|
| #include "ppapi/c/pp_instance.h"
|
| #include "ppapi/c/pp_macros.h"
|
| #include "ppapi/c/pp_resource.h"
|
| #include "ppapi/c/pp_stdint.h"
|
|
|
| -#define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2 \
|
| - "PPB_NetworkMonitor_Private;0.2"
|
| +#define PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3 \
|
| + "PPB_NetworkMonitor_Private;0.3"
|
| #define PPB_NETWORKMONITOR_PRIVATE_INTERFACE \
|
| - PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_2
|
| + PPB_NETWORKMONITOR_PRIVATE_INTERFACE_0_3
|
|
|
| /**
|
| * @file
|
| @@ -28,23 +29,6 @@
|
|
|
|
|
| /**
|
| - * @addtogroup Typedefs
|
| - * @{
|
| - */
|
| -/**
|
| - * <code>PPB_NetworkMonitor_Callback</code> is a callback function
|
| - * type that is used to receive notifications about network
|
| - * configuration changes. The <code>network_list</code> passed to this
|
| - * callback is a <code>PPB_NetworkList_Private</code> resource that
|
| - * contains current configuration of network interfaces.
|
| - */
|
| -typedef void (*PPB_NetworkMonitor_Callback)(void* user_data,
|
| - PP_Resource network_list);
|
| -/**
|
| - * @}
|
| - */
|
| -
|
| -/**
|
| * @addtogroup Interfaces
|
| * @{
|
| */
|
| @@ -52,29 +36,38 @@ typedef void (*PPB_NetworkMonitor_Callback)(void* user_data,
|
| * The <code>PPB_NetworkMonitor_Private</code> provides access to
|
| * notifications of network configuration changes.
|
| */
|
| -struct PPB_NetworkMonitor_Private_0_2 {
|
| +struct PPB_NetworkMonitor_Private_0_3 {
|
| /**
|
| - * Starts network change monitoring. The specified
|
| - * <code>callback</code> will be called on the main thread once
|
| - * after this method is called (to supply the initial network
|
| - * configuration) and then later every time network configuration
|
| - * changes. Notifications are stopped when the returned resource is
|
| - * destroyed. If the plugin doesn't have access to the network list
|
| - * then the callback will be called once with the
|
| - * <code>network_list</code> parameter is set to 0.
|
| + * Creates a Network Monitor resource.
|
| *
|
| - * @param[in] callback The callback that will be called every time
|
| - * network configuration changes or NULL to stop network monitoring.
|
| + * @param[in] instance A <code>PP_Instance</code> identifying one instance of
|
| + * a module.
|
| + *
|
| + * @return A <code>PP_Resource</code> corresponding to a network monitor or 0
|
| + * on failure.
|
| + */
|
| + PP_Resource (*Create)(PP_Instance instance);
|
| + /**
|
| + * Gets current network configuration. When called for the first time,
|
| + completes as
|
| + * soon as the current network configuration is received from the browser.
|
| + * Each consequent call will wait for network list changes, returning a new
|
| + * <code>PPB_NetworkList</code> resource every time.
|
| *
|
| - * @param[inout] user_data The data to be passed to the callback on
|
| - * each call.
|
| + * @param[in] network_monitor A <code>PP_Resource</code> corresponding to a
|
| + * network monitor.
|
| + * @param[out] network_list The <code>PPB_NetworkList<code> resource with the
|
| + * current state of network interfaces.
|
| + * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
|
| + * completion.
|
| *
|
| - * @return A <code>PP_Resource</code> containing the created
|
| - * NetworkMonitor resource.
|
| + * @return An int32_t containing an error code from <code>pp_errors.h</code>.
|
| + * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have
|
| + * required permissions.
|
| */
|
| - PP_Resource (*Create)(PP_Instance instance,
|
| - PPB_NetworkMonitor_Callback callback,
|
| - void* user_data);
|
| + int32_t (*UpdateNetworkList)(PP_Resource network_monitor,
|
| + PP_Resource* network_list,
|
| + struct PP_CompletionCallback callback);
|
| /**
|
| * Determines if the specified <code>resource</code> is a
|
| * <code>NetworkMonitor</code> object.
|
| @@ -88,7 +81,7 @@ struct PPB_NetworkMonitor_Private_0_2 {
|
| PP_Bool (*IsNetworkMonitor)(PP_Resource resource);
|
| };
|
|
|
| -typedef struct PPB_NetworkMonitor_Private_0_2 PPB_NetworkMonitor_Private;
|
| +typedef struct PPB_NetworkMonitor_Private_0_3 PPB_NetworkMonitor_Private;
|
| /**
|
| * @}
|
| */
|
|
|