| OLD | NEW |
| 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 Thu Jun 20 15:15:36 2013. */ | 6 /* From dev/ppb_udp_socket_dev.idl modified Thu Jun 20 15:15:36 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 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 the socket to the given address. | 109 * Binds the socket 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 * Gets the address that the socket is bound to. The socket must be bound. | 126 * Gets the address that the socket is bound to. The socket must be bound. |
| 127 * | 127 * |
| 128 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 128 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 129 * socket. | 129 * socket. |
| 130 * | 130 * |
| 131 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 131 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
| 132 * failure. | |
| 133 */ | 132 */ |
| 134 PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); | 133 PP_Resource (*GetBoundAddress)(PP_Resource udp_socket); |
| 135 /** | 134 /** |
| 136 * Receives data from the socket and stores the source address. The socket | 135 * Receives data from the socket and stores the source address. The socket |
| 137 * must be bound. | 136 * must be bound. |
| 138 * | 137 * |
| 139 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 138 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 140 * socket. | 139 * socket. |
| 141 * @param[out] buffer The buffer to store the received data on success. It | 140 * @param[out] buffer The buffer to store the received data on success. It |
| 142 * must be at least as large as <code>num_bytes</code>. | 141 * must be at least as large as <code>num_bytes</code>. |
| 143 * @param[in] num_bytes The number of bytes to receive. | 142 * @param[in] num_bytes The number of bytes to receive. |
| 144 * @param[out] addr A <code>PPB_NetAddress_Dev</code> resource to store the | 143 * @param[out] addr A <code>PPB_NetAddress</code> resource to store the source |
| 145 * source address on success. | 144 * address on success. |
| 146 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 145 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 147 * completion. | 146 * completion. |
| 148 * | 147 * |
| 149 * @return A non-negative number on success to indicate how many bytes have | 148 * @return A non-negative number on success to indicate how many bytes have |
| 150 * been received; otherwise, an error code from <code>pp_errors.h</code>. | 149 * been received; otherwise, an error code from <code>pp_errors.h</code>. |
| 151 */ | 150 */ |
| 152 int32_t (*RecvFrom)(PP_Resource udp_socket, | 151 int32_t (*RecvFrom)(PP_Resource udp_socket, |
| 153 char* buffer, | 152 char* buffer, |
| 154 int32_t num_bytes, | 153 int32_t num_bytes, |
| 155 PP_Resource* addr, | 154 PP_Resource* addr, |
| 156 struct PP_CompletionCallback callback); | 155 struct PP_CompletionCallback callback); |
| 157 /** | 156 /** |
| 158 * Sends data to a specific destination. The socket must be bound. | 157 * Sends data to a specific destination. The socket must be bound. |
| 159 * | 158 * |
| 160 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 159 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 161 * socket. | 160 * socket. |
| 162 * @param[in] buffer The buffer containing the data to send. | 161 * @param[in] buffer The buffer containing the data to send. |
| 163 * @param[in] num_bytes The number of bytes to send. | 162 * @param[in] num_bytes The number of bytes to send. |
| 164 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource holding the | 163 * @param[in] addr A <code>PPB_NetAddress</code> resource holding the |
| 165 * destination address. | 164 * destination address. |
| 166 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 165 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 167 * completion. | 166 * completion. |
| 168 * | 167 * |
| 169 * @return A non-negative number on success to indicate how many bytes have | 168 * @return A non-negative number on success to indicate how many bytes have |
| 170 * been sent; otherwise, an error code from <code>pp_errors.h</code>. | 169 * been sent; otherwise, an error code from <code>pp_errors.h</code>. |
| 171 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have | 170 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have |
| 172 * required permissions. | 171 * required permissions. |
| 173 */ | 172 */ |
| 174 int32_t (*SendTo)(PP_Resource udp_socket, | 173 int32_t (*SendTo)(PP_Resource udp_socket, |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 struct PP_CompletionCallback callback); | 209 struct PP_CompletionCallback callback); |
| 211 }; | 210 }; |
| 212 | 211 |
| 213 typedef struct PPB_UDPSocket_Dev_0_1 PPB_UDPSocket_Dev; | 212 typedef struct PPB_UDPSocket_Dev_0_1 PPB_UDPSocket_Dev; |
| 214 /** | 213 /** |
| 215 * @} | 214 * @} |
| 216 */ | 215 */ |
| 217 | 216 |
| 218 #endif /* PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ */ | 217 #endif /* PPAPI_C_DEV_PPB_UDP_SOCKET_DEV_H_ */ |
| 219 | 218 |
| OLD | NEW |