Roll src/third_party/WebKit ebb1ba5:b65f743 (svn 202609:202610)
[chromium-blink-merge.git] / ppapi / api / ppb_network_monitor.idl
blob361f7cbbeb49a8b830b970249649dc2585ccacdb
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 */
6 /**
7 * This file defines the <code>PPB_NetworkMonitor</code> interface.
8 */
10 [generate_thunk]
12 label Chrome {
13 M31 = 1.0
16 /**
17 * The <code>PPB_NetworkMonitor</code> allows to get network interfaces
18 * configuration and monitor network configuration changes.
20 * Permissions: Apps permission <code>socket</code> with subrule
21 * <code>network-state</code> is required for <code>UpdateNetworkList()</code>.
22 * For more details about network communication permissions, please see:
23 * http://developer.chrome.com/apps/app_network.html
25 interface PPB_NetworkMonitor {
26 /**
27 * Creates a Network Monitor resource.
29 * @param[in] instance A <code>PP_Instance</code> identifying one instance of
30 * a module.
32 * @return A <code>PP_Resource</code> corresponding to a network monitor or 0
33 * on failure.
35 PP_Resource Create([in] PP_Instance instance);
38 /**
39 * Gets current network configuration. When called for the first time,
40 * completes as soon as the current network configuration is received from
41 * the browser. Each consequent call will wait for network list changes,
42 * returning a new <code>PPB_NetworkList</code> resource every time.
44 * @param[in] network_monitor A <code>PP_Resource</code> corresponding to a
45 * network monitor.
46 * @param[out] network_list The <code>PPB_NetworkList<code> resource with the
47 * current state of network interfaces.
48 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
49 * completion.
51 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
52 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have
53 * required permissions.
55 int32_t UpdateNetworkList([in] PP_Resource network_monitor,
56 [out] PP_Resource network_list,
57 [in] PP_CompletionCallback callback);
59 /**
60 * Determines if the specified <code>resource</code> is a
61 * <code>NetworkMonitor</code> object.
63 * @param[in] resource A <code>PP_Resource</code> resource.
65 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is a
66 * <code>PPB_NetworkMonitor</code>, <code>PP_FALSE</code> otherwise.
68 PP_Bool IsNetworkMonitor([in] PP_Resource resource);