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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 /** 6 /**
7 * This file defines the <code>PPB_NetworkMonitor_Private</code> interface. 7 * This file defines the <code>PPB_NetworkMonitor_Private</code> interface.
8 */ 8 */
9 9
10 label Chrome { 10 label Chrome {
11 M19 = 0.2 11 M31 = 0.3
12 }; 12 };
13 13
14 /** 14 /**
15 * <code>PPB_NetworkMonitor_Callback</code> is a callback function
16 * type that is used to receive notifications about network
17 * configuration changes. The <code>network_list</code> passed to this
18 * callback is a <code>PPB_NetworkList_Private</code> resource that
19 * contains current configuration of network interfaces.
20 */
21 typedef void PPB_NetworkMonitor_Callback([inout] mem_t user_data,
22 [in] PP_Resource network_list);
23
24
25 /**
26 * The <code>PPB_NetworkMonitor_Private</code> provides access to 15 * The <code>PPB_NetworkMonitor_Private</code> provides access to
27 * notifications of network configuration changes. 16 * notifications of network configuration changes.
28 */ 17 */
29 interface PPB_NetworkMonitor_Private { 18 interface PPB_NetworkMonitor_Private {
30 /** 19 /**
31 * Starts network change monitoring. The specified 20 * Creates a Network Monitor resource.
32 * <code>callback</code> will be called on the main thread once
33 * after this method is called (to supply the initial network
34 * configuration) and then later every time network configuration
35 * changes. Notifications are stopped when the returned resource is
36 * destroyed. If the plugin doesn't have access to the network list
37 * then the callback will be called once with the
38 * <code>network_list</code> parameter is set to 0.
39 * 21 *
40 * @param[in] callback The callback that will be called every time 22 * @param[in] instance A <code>PP_Instance</code> identifying one instance of
41 * network configuration changes or NULL to stop network monitoring. 23 * a module.
42 * 24 *
43 * @param[inout] user_data The data to be passed to the callback on 25 * @return A <code>PP_Resource</code> corresponding to a network monitor or 0
44 * each call. 26 * on failure.
27 */
28 PP_Resource Create([in] PP_Instance instance);
29
30
31 /**
32 * Gets current network configuration. When called for the first time, complet es as
yzshen1 2013/09/04 19:52:01 - longer than 80 chars
Sergey Ulanov 2013/09/04 22:22:32 Done.
33 * soon as the current network configuration is received from the browser.
34 * Each consequent call will wait for network list changes, returning a new
35 * <code>PPB_NetworkList</code> resource every time.
45 * 36 *
46 * @return A <code>PP_Resource</code> containing the created 37 * @param[in] network_monitor A <code>PP_Resource</code> corresponding to a
47 * NetworkMonitor resource. 38 * network monitor.
39 * @param[out] network_list The <code>PPB_NetworkList<code> resource with the
40 * current state of network interfaces.
41 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
42 * completion.
43 *
44 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
45 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have
46 * required permissions.
48 */ 47 */
49 PP_Resource Create([in] PP_Instance instance, 48 int32_t UpdateNetworkList([in] PP_Resource network_monitor,
50 [in] PPB_NetworkMonitor_Callback callback, 49 [out] PP_Resource network_list,
51 [inout] mem_t user_data); 50 [in] PP_CompletionCallback callback);
52 51
53 /** 52 /**
54 * Determines if the specified <code>resource</code> is a 53 * Determines if the specified <code>resource</code> is a
55 * <code>NetworkMonitor</code> object. 54 * <code>NetworkMonitor</code> object.
56 * 55 *
57 * @param[in] resource A <code>PP_Resource</code> resource. 56 * @param[in] resource A <code>PP_Resource</code> resource.
58 * 57 *
59 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is 58 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is
60 * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code> 59 * a <code>PPB_NetworkMonitor_Private</code>, <code>PP_FALSE</code>
61 * otherwise. 60 * otherwise.
62 */ 61 */
63 PP_Bool IsNetworkMonitor([in] PP_Resource resource); 62 PP_Bool IsNetworkMonitor([in] PP_Resource resource);
64 }; 63 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698