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

Side by Side Diff: ppapi/api/ppb_network_list.idl

Issue 23450012: Make NetworkList and NetworkMonitor APIs public (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
(Empty)
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
yzshen1 2013/08/30 17:31:46 nit: 2013.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /**
7 * This file defines the <code>PPB_NetworkList</code> interface.
8 */
9
10 [generate_thunk]
11
12 label Chrome {
13 M31 = 1.0
14 };
15
16 /**
17 * Type of a network interface.
18 */
19 [assert_size(4)]
20 enum PP_NetworkListType {
21 /**
22 * Type of the network interface is not known.
23 */
24 PP_NETWORKLIST_UNKNOWN = 0,
25
26 /**
27 * Wired Ethernet network.
28 */
29 PP_NETWORKLIST_ETHERNET = 1,
30
31 /**
32 * Wireless Wi-Fi network.
33 */
34 PP_NETWORKLIST_WIFI = 2,
35
36 /**
37 * Cellular network (e.g. LTE).
38 */
39 PP_NETWORKLIST_CELLULAR = 3
40 };
41
42 /**
43 * State of a network interface.
44 */
45 [assert_size(4)]
46 enum PP_NetworkListState {
47 /**
48 * Network interface is down.
49 */
50 PP_NETWORKLIST_DOWN = 0,
yzshen1 2013/08/30 17:31:46 - Both enum has PP_NETWORKLIST_ prefix. Shall we u
51
52 /**
53 * Network interface is up.
54 */
55 PP_NETWORKLIST_UP = 1
56 };
57
58 /**
59 * The <code>PPB_NetworkList</code> is used to represent a list of
60 * network interfaces and their configuration. The content of the list
61 * is immutable. The current networks configuration can be received
62 * using the <code>PPB_NetworkMonitor</code> interface.
63 */
64 interface PPB_NetworkList {
65 /**
66 * Determines if the specified <code>resource</code> is a
67 * <code>NetworkList</code> object.
68 *
69 * @param[in] resource A <code>PP_Resource</code> resource.
70 *
71 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is
72 * a <code>PPB_NetworkList</code>, <code>PP_FALSE</code>
73 * otherwise.
74 */
75 PP_Bool IsNetworkList([in] PP_Resource resource);
76
77 /**
78 * Gets number of interfaces in the list.
79 *
80 * @return Returns number of available network interfaces or 0 if
81 * the list has never been updated.
82 */
83 uint32_t GetCount([in] PP_Resource resource);
84
85 /**
86 * Gets name of a network interface.
87 *
88 * @param[in] resource A <code>PP_Resource</code> corresponding to a
89 * network list.
90 * @param[in] index Index of the network interface.
91 *
92 * @return Returns name for the network interface with the specified
93 * <code>index</code>.
94 */
95 PP_Var GetName([in] PP_Resource resource,
96 [in] uint32_t index);
97
98 /**
99 * Gets type of a network interface.
100 *
101 * @param[in] resource A <code>PP_Resource</code> corresponding to a
102 * network list.
103 * @param[in] index Index of the network interface.
104 *
105 * @return Returns type of the network interface with the specified
106 * <code>index</code>.
107 */
108 [on_failure=PP_NETWORKLIST_UNKNOWN]
109 PP_NetworkListType GetType([in] PP_Resource resource,
110 [in] uint32_t index);
111
112 /**
113 * Gets state of a network interface.
114 *
115 * @param[in] resource A <code>PP_Resource</code> corresponding to a
116 * network list.
117 * @param[in] index Index of the network interface.
118 *
119 * @return Returns current state of the network interface with the
120 * specified <code>index</code>.
121 */
122 [on_failure=PP_NETWORKLIST_DOWN]
123 PP_NetworkListState GetState([in] PP_Resource resource,
124 [in] uint32_t index);
125
126 /**
127 * Gets list of IP addresses for a network interface.
128 *
129 * @param[in] resource A <code>PP_Resource</code> corresponding to a
130 * network list.
131 * @param[in] index Index of the network interface.
132 * @param[in] output An output array which will receive
133 * <code>PPB_NetAddress</code> resources on success. Please note that the
134 * ref count of those resources has already been increased by 1 for the
135 * caller.
136 *
137 * @return An error code from <code>pp_errors.h</code>.
138 */
139 int32_t GetIpAddresses([in] PP_Resource resource,
140 [in] uint32_t index,
141 [in] PP_ArrayOutput output);
142
143 /**
144 * Gets display name of a network interface.
145 *
146 * @param[in] resource A <code>PP_Resource</code> corresponding to a
147 * network list.
148 * @param[in] index Index of the network interface.
149 *
150 * @return Returns display name for the network interface with the
151 * specified <code>index</code>.
yzshen1 2013/08/30 17:31:46 It seems good to comment about the failure output.
152 */
153 PP_Var GetDisplayName([in] PP_Resource resource,
154 [in] uint32_t index);
155
156 /**
157 * Gets MTU (Maximum Transmission Unit) of a network interface.
158 *
159 * @param[in] resource A <code>PP_Resource</code> corresponding to a
160 * network list.
161 * @param[in] index Index of the network interface.
162 *
163 * @return Returns MTU for the network interface with the specified
164 * <code>index</code> or 0 if MTU is unknown.
165 */
166 uint32_t GetMTU([in] PP_Resource resource,
167 [in] uint32_t index);
168
169 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698