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

Side by Side Diff: ppapi/c/dev/ppb_udp_socket_dev.h

Issue 17419008: Move PPB_NetAddress out of dev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 /* Copyright 2013 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 /* From dev/ppb_udp_socket_dev.idl modified Wed Jun 19 23:51:27 2013. */ 6 /* From dev/ppb_udp_socket_dev.idl modified Thu Jun 20 11:03:32 2013. */
7 7
8 #ifndef PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ 8 #ifndef PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_
9 #define PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ 9 #define PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h" 12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h" 13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_resource.h" 15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 * @return <code>PP_TRUE</code> if the input is a 103 * @return <code>PP_TRUE</code> if the input is a
104 * <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code> 104 * <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code>
105 * otherwise. 105 * otherwise.
106 */ 106 */
107 PP_Bool (*IsUDPSocket)(PP_Resource resource); 107 PP_Bool (*IsUDPSocket)(PP_Resource resource);
108 /** 108 /**
109 * Binds to the given address. 109 * Binds to the given address.
110 * 110 *
111 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP 111 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
112 * socket. 112 * socket.
113 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource. 113 * @param[in] addr A <code>PPB_NetAddress</code> resource.
114 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon 114 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
115 * completion. 115 * completion.
116 * 116 *
117 * @return An int32_t containing an error code from <code>pp_errors.h</code>. 117 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
118 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have 118 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have
119 * required permissions. <code>PP_ERROR_ADDRESS_IN_USE</code> will be returned 119 * required permissions. <code>PP_ERROR_ADDRESS_IN_USE</code> will be returned
120 * if the address is already in use. 120 * if the address is already in use.
121 */ 121 */
122 int32_t (*Bind)(PP_Resource udp_socket, 122 int32_t (*Bind)(PP_Resource udp_socket,
123 PP_Resource addr, 123 PP_Resource addr,
124 struct PP_CompletionCallback callback); 124 struct PP_CompletionCallback callback);
125 /** 125 /**
126 * Get the address that the socket has bound to. It can only be called after 126 * Get the address that the socket has bound to. It can only be called after
127 * a successful <code>Bind()</code> call. 127 * a successful <code>Bind()</code> call.
128 * 128 *
129 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP 129 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
130 * socket. 130 * socket.
131 * 131 *
132 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on 132 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure.
133 * failure.
134 */ 133 */
135 PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); 134 PP_Resource (*GetBoundAddress)(PP_Resource udp_socket);
136 /** 135 /**
137 * Receives data from the socket and stores the source address. It can only be 136 * Receives data from the socket and stores the source address. It can only be
138 * called after a successful <code>Bind()</code> call. 137 * called after a successful <code>Bind()</code> call.
139 * 138 *
140 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP 139 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
141 * socket. 140 * socket.
142 * @param[out] buffer The buffer to store the received data on success. It 141 * @param[out] buffer The buffer to store the received data on success. It
143 * must be at least as large as <code>num_bytes</code>. 142 * must be at least as large as <code>num_bytes</code>.
144 * @param[in] num_bytes The number of bytes to read. 143 * @param[in] num_bytes The number of bytes to read.
145 * @param[out] addr A <code>PPB_NetAddress_Dev</code> resource to store the 144 * @param[out] addr A <code>PPB_NetAddress</code> resource to store the source
146 * source address on success. 145 * address on success.
147 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon 146 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
148 * completion. 147 * completion.
149 * 148 *
150 * @return A non-negative number on success to indicate how many bytes have 149 * @return A non-negative number on success to indicate how many bytes have
151 * been received; otherwise, an error code from <code>pp_errors.h</code>. 150 * been received; otherwise, an error code from <code>pp_errors.h</code>.
152 */ 151 */
153 int32_t (*RecvFrom)(PP_Resource udp_socket, 152 int32_t (*RecvFrom)(PP_Resource udp_socket,
154 char* buffer, 153 char* buffer,
155 int32_t num_bytes, 154 int32_t num_bytes,
156 PP_Resource* addr, 155 PP_Resource* addr,
157 struct PP_CompletionCallback callback); 156 struct PP_CompletionCallback callback);
158 /** 157 /**
159 * Sends data to a specific destination. It can only be called after a 158 * Sends data to a specific destination. It can only be called after a
160 * successful <code>Bind()</code> call. 159 * successful <code>Bind()</code> call.
161 * 160 *
162 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP 161 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
163 * socket. 162 * socket.
164 * @param[in] buffer The buffer containing the data to send. 163 * @param[in] buffer The buffer containing the data to send.
165 * @param[in] num_bytes The number of bytes to send. 164 * @param[in] num_bytes The number of bytes to send.
166 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource holding the 165 * @param[in] addr A <code>PPB_NetAddress</code> resource holding the target
167 * target address. 166 * address.
168 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon 167 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
169 * completion. 168 * completion.
170 * 169 *
171 * @return A non-negative number on success to indicate how many bytes have 170 * @return A non-negative number on success to indicate how many bytes have
172 * been sent; otherwise, an error code from <code>pp_errors.h</code>. 171 * been sent; otherwise, an error code from <code>pp_errors.h</code>.
173 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have 172 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have
174 * required permissions. 173 * required permissions.
175 */ 174 */
176 int32_t (*SendTo)(PP_Resource udp_socket, 175 int32_t (*SendTo)(PP_Resource udp_socket,
177 const char* buffer, 176 const char* buffer,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 struct PP_CompletionCallback callback); 211 struct PP_CompletionCallback callback);
213 }; 212 };
214 213
215 typedef struct PPB_UDPSocket_Dev_0_1 PPB_UDPSocket_Dev; 214 typedef struct PPB_UDPSocket_Dev_0_1 PPB_UDPSocket_Dev;
216 /** 215 /**
217 * @} 216 * @}
218 */ 217 */
219 218
220 #endif /* PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ */ 219 #endif /* PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ */
221 220
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698