| 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 /** | 6 /** |
| 7 * This file defines the <code>PPB_URLRequestInfo</code> API for creating and | 7 * This file defines the <code>PPB_URLRequestInfo</code> API for creating and |
| 8 * manipulating URL requests. | 8 * manipulating URL requests. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 /** | 146 /** |
| 147 * The <code>PPB_URLRequestInfo</code> interface is used to create | 147 * The <code>PPB_URLRequestInfo</code> interface is used to create |
| 148 * and handle URL requests. This API is used in conjunction with | 148 * and handle URL requests. This API is used in conjunction with |
| 149 * <code>PPB_URLLoader</code>. Refer to <code>PPB_URLLoader</code> for further | 149 * <code>PPB_URLLoader</code>. Refer to <code>PPB_URLLoader</code> for further |
| 150 * information. | 150 * information. |
| 151 */ | 151 */ |
| 152 interface PPB_URLRequestInfo { | 152 interface PPB_URLRequestInfo { |
| 153 /** | 153 /** |
| 154 * Create() creates a new <code>URLRequestInfo</code> object. | 154 * Create() creates a new <code>URLRequestInfo</code> object. |
| 155 * | 155 * |
| 156 * @param[in] instance A <code>PP_Instance</code> indentifying one instance | 156 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 157 * of a module. | 157 * of a module. |
| 158 * | 158 * |
| 159 * @return A <code>PP_Resource</code> identifying the | 159 * @return A <code>PP_Resource</code> identifying the |
| 160 * <code>URLRequestInfo</code> if successful, 0 if the instance is invalid. | 160 * <code>URLRequestInfo</code> if successful, 0 if the instance is invalid. |
| 161 */ | 161 */ |
| 162 PP_Resource Create( | 162 PP_Resource Create( |
| 163 [in] PP_Instance instance); | 163 [in] PP_Instance instance); |
| 164 | 164 |
| 165 /** | 165 /** |
| 166 * IsURLRequestInfo() determines if a resource is a | 166 * IsURLRequestInfo() determines if a resource is a |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 [in] PP_Resource request, | 212 [in] PP_Resource request, |
| 213 [in] mem_t data, | 213 [in] mem_t data, |
| 214 [in] uint32_t len); | 214 [in] uint32_t len); |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * AppendFileToBody() appends a file, to be uploaded, to the request body. | 217 * AppendFileToBody() appends a file, to be uploaded, to the request body. |
| 218 * A content-length request header will be automatically generated. | 218 * A content-length request header will be automatically generated. |
| 219 * | 219 * |
| 220 * @param[in] request A <code>PP_Resource</code> corresponding to a | 220 * @param[in] request A <code>PP_Resource</code> corresponding to a |
| 221 * <code>URLRequestInfo</code>. | 221 * <code>URLRequestInfo</code>. |
| 222 * @param[in] file_ref A <code>PP_Resource</code> containing the file | 222 * @param[in] file_ref A <code>PP_Resource</code> corresponding to a file |
| 223 * reference. | 223 * reference. |
| 224 * @param[in] start_offset An optional starting point offset within the | 224 * @param[in] start_offset An optional starting point offset within the |
| 225 * file. | 225 * file. |
| 226 * @param[in] number_of_bytes An optional number of bytes of the file to | 226 * @param[in] number_of_bytes An optional number of bytes of the file to |
| 227 * be included. If <code>number_of_bytes</code> is -1, then the sub-range | 227 * be included. If <code>number_of_bytes</code> is -1, then the sub-range |
| 228 * to upload extends to the end of the file. | 228 * to upload extends to the end of the file. |
| 229 * @param[in] expected_last_modified_time An optional (non-zero) last | 229 * @param[in] expected_last_modified_time An optional (non-zero) last |
| 230 * modified time stamp used to validate that the file was not modified since | 230 * modified time stamp used to validate that the file was not modified since |
| 231 * the given time before it was uploaded. The upload will fail with an error | 231 * the given time before it was uploaded. The upload will fail with an error |
| 232 * code of <code>PP_ERROR_FILECHANGED</code> if the file has been modified | 232 * code of <code>PP_ERROR_FILECHANGED</code> if the file has been modified |
| 233 * since the given time. If <code>expected_last_modified_time</code> is 0, | 233 * since the given time. If <code>expected_last_modified_time</code> is 0, |
| 234 * then no validation is performed. | 234 * then no validation is performed. |
| 235 * | 235 * |
| 236 * @return <code>PP_TRUE</code> if successful, <code>PP_FALSE</code> if any | 236 * @return <code>PP_TRUE</code> if successful, <code>PP_FALSE</code> if any |
| 237 * of the parameters are invalid. | 237 * of the parameters are invalid. |
| 238 */ | 238 */ |
| 239 PP_Bool AppendFileToBody( | 239 PP_Bool AppendFileToBody( |
| 240 [in] PP_Resource request, | 240 [in] PP_Resource request, |
| 241 [in] PP_Resource file_ref, | 241 [in] PP_Resource file_ref, |
| 242 [in] int64_t start_offset, | 242 [in] int64_t start_offset, |
| 243 [in] int64_t number_of_bytes, | 243 [in] int64_t number_of_bytes, |
| 244 [in] PP_Time expected_last_modified_time); | 244 [in] PP_Time expected_last_modified_time); |
| 245 }; | 245 }; |
| 246 | 246 |
| OLD | NEW |