| 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 /** | 6 /** |
| 7 * This file defines the <code>PPB_UDPSocket_Dev</code> interface. | 7 * This file defines the <code>PPB_UDPSocket_Dev</code> interface. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 [generate_thunk] | 10 [generate_thunk] |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 * <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code> | 85 * <code>PPB_UDPSocket_Dev</code> resource; <code>PP_FALSE</code> |
| 86 * otherwise. | 86 * otherwise. |
| 87 */ | 87 */ |
| 88 PP_Bool IsUDPSocket([in] PP_Resource resource); | 88 PP_Bool IsUDPSocket([in] PP_Resource resource); |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * Binds the socket to the given address. | 91 * Binds the socket to the given address. |
| 92 * | 92 * |
| 93 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 93 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 94 * socket. | 94 * socket. |
| 95 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource. | 95 * @param[in] addr A <code>PPB_NetAddress</code> resource. |
| 96 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 96 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 97 * completion. | 97 * completion. |
| 98 * | 98 * |
| 99 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 99 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 100 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have | 100 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have |
| 101 * required permissions. <code>PP_ERROR_ADDRESS_IN_USE</code> will be returned | 101 * required permissions. <code>PP_ERROR_ADDRESS_IN_USE</code> will be returned |
| 102 * if the address is already in use. | 102 * if the address is already in use. |
| 103 */ | 103 */ |
| 104 int32_t Bind([in] PP_Resource udp_socket, | 104 int32_t Bind([in] PP_Resource udp_socket, |
| 105 [in] PP_Resource addr, | 105 [in] PP_Resource addr, |
| 106 [in] PP_CompletionCallback callback); | 106 [in] PP_CompletionCallback callback); |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * Gets the address that the socket is bound to. The socket must be bound. | 109 * Gets the address that the socket is bound to. The socket must be bound. |
| 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 * | 113 * |
| 114 * @return A <code>PPB_NetAddress_Dev</code> resource on success or 0 on | 114 * @return A <code>PPB_NetAddress</code> resource on success or 0 on failure. |
| 115 * failure. | |
| 116 */ | 115 */ |
| 117 PP_Resource GetBoundAddress([in] PP_Resource udp_socket); | 116 PP_Resource GetBoundAddress([in] PP_Resource udp_socket); |
| 118 | 117 |
| 119 /** | 118 /** |
| 120 * Receives data from the socket and stores the source address. The socket | 119 * Receives data from the socket and stores the source address. The socket |
| 121 * must be bound. | 120 * must be bound. |
| 122 * | 121 * |
| 123 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 122 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 124 * socket. | 123 * socket. |
| 125 * @param[out] buffer The buffer to store the received data on success. It | 124 * @param[out] buffer The buffer to store the received data on success. It |
| 126 * must be at least as large as <code>num_bytes</code>. | 125 * must be at least as large as <code>num_bytes</code>. |
| 127 * @param[in] num_bytes The number of bytes to receive. | 126 * @param[in] num_bytes The number of bytes to receive. |
| 128 * @param[out] addr A <code>PPB_NetAddress_Dev</code> resource to store the | 127 * @param[out] addr A <code>PPB_NetAddress</code> resource to store the source |
| 129 * source address on success. | 128 * address on success. |
| 130 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 129 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 131 * completion. | 130 * completion. |
| 132 * | 131 * |
| 133 * @return A non-negative number on success to indicate how many bytes have | 132 * @return A non-negative number on success to indicate how many bytes have |
| 134 * been received; otherwise, an error code from <code>pp_errors.h</code>. | 133 * been received; otherwise, an error code from <code>pp_errors.h</code>. |
| 135 */ | 134 */ |
| 136 int32_t RecvFrom([in] PP_Resource udp_socket, | 135 int32_t RecvFrom([in] PP_Resource udp_socket, |
| 137 [out] str_t buffer, | 136 [out] str_t buffer, |
| 138 [in] int32_t num_bytes, | 137 [in] int32_t num_bytes, |
| 139 [out] PP_Resource addr, | 138 [out] PP_Resource addr, |
| 140 [in] PP_CompletionCallback callback); | 139 [in] PP_CompletionCallback callback); |
| 141 | 140 |
| 142 /** | 141 /** |
| 143 * Sends data to a specific destination. The socket must be bound. | 142 * Sends data to a specific destination. The socket must be bound. |
| 144 * | 143 * |
| 145 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP | 144 * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP |
| 146 * socket. | 145 * socket. |
| 147 * @param[in] buffer The buffer containing the data to send. | 146 * @param[in] buffer The buffer containing the data to send. |
| 148 * @param[in] num_bytes The number of bytes to send. | 147 * @param[in] num_bytes The number of bytes to send. |
| 149 * @param[in] addr A <code>PPB_NetAddress_Dev</code> resource holding the | 148 * @param[in] addr A <code>PPB_NetAddress</code> resource holding the |
| 150 * destination address. | 149 * destination address. |
| 151 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 150 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 152 * completion. | 151 * completion. |
| 153 * | 152 * |
| 154 * @return A non-negative number on success to indicate how many bytes have | 153 * @return A non-negative number on success to indicate how many bytes have |
| 155 * been sent; otherwise, an error code from <code>pp_errors.h</code>. | 154 * been sent; otherwise, an error code from <code>pp_errors.h</code>. |
| 156 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have | 155 * <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have |
| 157 * required permissions. | 156 * required permissions. |
| 158 */ | 157 */ |
| 159 int32_t SendTo([in] PP_Resource udp_socket, | 158 int32_t SendTo([in] PP_Resource udp_socket, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 189 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 188 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
| 190 * completion. | 189 * completion. |
| 191 * | 190 * |
| 192 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | 191 * @return An int32_t containing an error code from <code>pp_errors.h</code>. |
| 193 */ | 192 */ |
| 194 int32_t SetOption([in] PP_Resource udp_socket, | 193 int32_t SetOption([in] PP_Resource udp_socket, |
| 195 [in] PP_UDPSocket_Option_Dev name, | 194 [in] PP_UDPSocket_Option_Dev name, |
| 196 [in] PP_Var value, | 195 [in] PP_Var value, |
| 197 [in] PP_CompletionCallback callback); | 196 [in] PP_CompletionCallback callback); |
| 198 }; | 197 }; |
| OLD | NEW |