Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: ppapi/api/private/ppb_network_monitor_private.idl

Issue 23453025: Refactor PPB_NetworkMonitor_Private interface to use CompletionCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/resource_creation_impl.cc ('k') | ppapi/c/private/ppb_network_monitor_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/private/ppb_network_monitor_private.idl
diff --git a/ppapi/api/private/ppb_network_monitor_private.idl b/ppapi/api/private/ppb_network_monitor_private.idl
index fe264a616bc16326f969518501f358709646b2d1..eae06a3b12ec48512ee46dd53eb9ac465921f550 100644
--- a/ppapi/api/private/ppb_network_monitor_private.idl
+++ b/ppapi/api/private/ppb_network_monitor_private.idl
@@ -7,48 +7,49 @@
* This file defines the <code>PPB_NetworkMonitor_Private</code> interface.
*/
+[generate_thunk]
+
label Chrome {
- M19 = 0.2
+ M31 = 0.3
};
/**
- * <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([inout] mem_t user_data,
- [in] PP_Resource network_list);
-
-
-/**
* The <code>PPB_NetworkMonitor_Private</code> provides access to
* notifications of network configuration changes.
*/
interface PPB_NetworkMonitor_Private {
/**
- * 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([in] 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([in] PP_Instance instance,
- [in] PPB_NetworkMonitor_Callback callback,
- [inout] mem_t user_data);
+ int32_t UpdateNetworkList([in] PP_Resource network_monitor,
+ [out] PP_Resource network_list,
+ [in] PP_CompletionCallback callback);
/**
* Determines if the specified <code>resource</code> is a
« no previous file with comments | « content/renderer/pepper/resource_creation_impl.cc ('k') | ppapi/c/private/ppb_network_monitor_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698