OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 ppb_url_request_info.idl modified Wed Aug 24 20:53:00 2011. */ | 6 /* From ppb_url_request_info.idl modified Mon Aug 29 10:11:34 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ | 8 #ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
9 #define PPAPI_C_PPB_URL_REQUEST_INFO_H_ | 9 #define PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 #include "ppapi/c/pp_time.h" | 16 #include "ppapi/c/pp_time.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 /** | 159 /** |
160 * The <code>PPB_URLRequestInfo</code> interface is used to create | 160 * The <code>PPB_URLRequestInfo</code> interface is used to create |
161 * and handle URL requests. This API is used in conjunction with | 161 * and handle URL requests. This API is used in conjunction with |
162 * <code>PPB_URLLoader</code>. Refer to <code>PPB_URLLoader</code> for further | 162 * <code>PPB_URLLoader</code>. Refer to <code>PPB_URLLoader</code> for further |
163 * information. | 163 * information. |
164 */ | 164 */ |
165 struct PPB_URLRequestInfo { | 165 struct PPB_URLRequestInfo { |
166 /** | 166 /** |
167 * Create() creates a new <code>URLRequestInfo</code> object. | 167 * Create() creates a new <code>URLRequestInfo</code> object. |
168 * | 168 * |
169 * @param[in] instance A <code>PP_Instance</code> indentifying one instance | 169 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
170 * of a module. | 170 * of a module. |
171 * | 171 * |
172 * @return A <code>PP_Resource</code> identifying the | 172 * @return A <code>PP_Resource</code> identifying the |
173 * <code>URLRequestInfo</code> if successful, 0 if the instance is invalid. | 173 * <code>URLRequestInfo</code> if successful, 0 if the instance is invalid. |
174 */ | 174 */ |
175 PP_Resource (*Create)(PP_Instance instance); | 175 PP_Resource (*Create)(PP_Instance instance); |
176 /** | 176 /** |
177 * IsURLRequestInfo() determines if a resource is a | 177 * IsURLRequestInfo() determines if a resource is a |
178 * <code>URLRequestInfo</code>. | 178 * <code>URLRequestInfo</code>. |
179 * | 179 * |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 */ | 217 */ |
218 PP_Bool (*AppendDataToBody)(PP_Resource request, | 218 PP_Bool (*AppendDataToBody)(PP_Resource request, |
219 const void* data, | 219 const void* data, |
220 uint32_t len); | 220 uint32_t len); |
221 /** | 221 /** |
222 * AppendFileToBody() appends a file, to be uploaded, to the request body. | 222 * AppendFileToBody() appends a file, to be uploaded, to the request body. |
223 * A content-length request header will be automatically generated. | 223 * A content-length request header will be automatically generated. |
224 * | 224 * |
225 * @param[in] request A <code>PP_Resource</code> corresponding to a | 225 * @param[in] request A <code>PP_Resource</code> corresponding to a |
226 * <code>URLRequestInfo</code>. | 226 * <code>URLRequestInfo</code>. |
227 * @param[in] file_ref A <code>PP_Resource</code> containing the file | 227 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file |
228 * reference. | 228 * reference. |
229 * @param[in] start_offset An optional starting point offset within the | 229 * @param[in] start_offset An optional starting point offset within the |
230 * file. | 230 * file. |
231 * @param[in] number_of_bytes An optional number of bytes of the file to | 231 * @param[in] number_of_bytes An optional number of bytes of the file to |
232 * be included. If <code>number_of_bytes</code> is -1, then the sub-range | 232 * be included. If <code>number_of_bytes</code> is -1, then the sub-range |
233 * to upload extends to the end of the file. | 233 * to upload extends to the end of the file. |
234 * @param[in] expected_last_modified_time An optional (non-zero) last | 234 * @param[in] expected_last_modified_time An optional (non-zero) last |
235 * modified time stamp used to validate that the file was not modified since | 235 * modified time stamp used to validate that the file was not modified since |
236 * the given time before it was uploaded. The upload will fail with an error | 236 * the given time before it was uploaded. The upload will fail with an error |
237 * code of <code>PP_ERROR_FILECHANGED</code> if the file has been modified | 237 * code of <code>PP_ERROR_FILECHANGED</code> if the file has been modified |
238 * since the given time. If <code>expected_last_modified_time</code> is 0, | 238 * since the given time. If <code>expected_last_modified_time</code> is 0, |
239 * then no validation is performed. | 239 * then no validation is performed. |
240 * | 240 * |
241 * @return <code>PP_TRUE</code> if successful, <code>PP_FALSE</code> if any | 241 * @return <code>PP_TRUE</code> if successful, <code>PP_FALSE</code> if any |
242 * of the parameters are invalid. | 242 * of the parameters are invalid. |
243 */ | 243 */ |
244 PP_Bool (*AppendFileToBody)(PP_Resource request, | 244 PP_Bool (*AppendFileToBody)(PP_Resource request, |
245 PP_Resource file_ref, | 245 PP_Resource file_ref, |
246 int64_t start_offset, | 246 int64_t start_offset, |
247 int64_t number_of_bytes, | 247 int64_t number_of_bytes, |
248 PP_Time expected_last_modified_time); | 248 PP_Time expected_last_modified_time); |
249 }; | 249 }; |
250 /** | 250 /** |
251 * @} | 251 * @} |
252 */ | 252 */ |
253 | 253 |
254 #endif /* PPAPI_C_PPB_URL_REQUEST_INFO_H_ */ | 254 #endif /* PPAPI_C_PPB_URL_REQUEST_INFO_H_ */ |
255 | 255 |
OLD | NEW |