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