OLD | NEW |
1 /* Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ | 5 #ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
6 #define PPAPI_C_PPB_URL_REQUEST_INFO_H_ | 6 #define PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_macros.h" | 10 #include "ppapi/c/pp_macros.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 #include "ppapi/c/pp_time.h" | 13 #include "ppapi/c/pp_time.h" |
14 | 14 |
15 struct PP_Var; | 15 struct PP_Var; |
16 | 16 |
| 17 /** |
| 18 * @file |
| 19 * Defines the API ... |
| 20 */ |
| 21 |
| 22 /** |
| 23 * |
| 24 * @addtogroup Enums |
| 25 * @{ |
| 26 */ |
17 typedef enum { | 27 typedef enum { |
18 PP_URLREQUESTPROPERTY_URL, // string | 28 PP_URLREQUESTPROPERTY_URL, // string |
19 PP_URLREQUESTPROPERTY_METHOD, // string | 29 PP_URLREQUESTPROPERTY_METHOD, // string |
20 PP_URLREQUESTPROPERTY_HEADERS, // string, \n-delim | 30 PP_URLREQUESTPROPERTY_HEADERS, // string, \n-delim |
21 PP_URLREQUESTPROPERTY_STREAMTOFILE, // PP_Bool (default=PP_FALSE) | 31 PP_URLREQUESTPROPERTY_STREAMTOFILE, // PP_Bool (default=PP_FALSE) |
22 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, // PP_Bool (default=PP_TRUE) | 32 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, // PP_Bool (default=PP_TRUE) |
23 | 33 |
24 // Set to true if you want to be able to poll the download progress via the | 34 // Set to true if you want to be able to poll the download progress via the |
25 // URLLoader.GetDownloadProgress function. | 35 // URLLoader.GetDownloadProgress function. |
26 // | 36 // |
27 // Boolean (default = PP_FALSE). | 37 // Boolean (default = PP_FALSE). |
28 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, | 38 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, |
29 | 39 |
30 // Set to true if you want to be able to pull the upload progress via the | 40 // Set to true if you want to be able to pull the upload progress via the |
31 // URLLoader.GetUploadProgress function. | 41 // URLLoader.GetUploadProgress function. |
32 // | 42 // |
33 // Boolean (default = PP_FALSE). | 43 // Boolean (default = PP_FALSE). |
34 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS | 44 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS |
35 } PP_URLRequestProperty; | 45 } PP_URLRequestProperty; |
| 46 /** |
| 47 * @} |
| 48 */ |
| 49 |
36 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLRequestProperty, 4); | 50 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_URLRequestProperty, 4); |
37 | 51 |
38 #define PPB_URLREQUESTINFO_INTERFACE "PPB_URLRequestInfo;0.2" | 52 #define PPB_URLREQUESTINFO_INTERFACE "PPB_URLRequestInfo;0.2" |
39 | 53 |
| 54 /** |
| 55 * |
| 56 * @addtogroup Interfaces |
| 57 * @{ |
| 58 */ |
40 struct PPB_URLRequestInfo { | 59 struct PPB_URLRequestInfo { |
41 // Create a new URLRequestInfo object. Returns 0 if the module is invalid. | 60 // Create a new URLRequestInfo object. Returns 0 if the module is invalid. |
42 PP_Resource (*Create)(PP_Instance instance); | 61 PP_Resource (*Create)(PP_Instance instance); |
43 | 62 |
44 // Returns PP_TRUE if the given resource is an URLRequestInfo. Returns | 63 // Returns PP_TRUE if the given resource is an URLRequestInfo. Returns |
45 // PP_FALSE if the resource is invalid or some type other than an | 64 // PP_FALSE if the resource is invalid or some type other than an |
46 // URLRequestInfo. | 65 // URLRequestInfo. |
47 PP_Bool (*IsURLRequestInfo)(PP_Resource resource); | 66 PP_Bool (*IsURLRequestInfo)(PP_Resource resource); |
48 | 67 |
49 // Sets a request property. Returns PP_FALSE if any of the parameters are | 68 // Sets a request property. Returns PP_FALSE if any of the parameters are |
(...skipping 26 matching lines...) Expand all Loading... |
76 // | 95 // |
77 // A Content-Length request header will be automatically generated. | 96 // A Content-Length request header will be automatically generated. |
78 // | 97 // |
79 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. | 98 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. |
80 PP_Bool (*AppendFileToBody)(PP_Resource request, | 99 PP_Bool (*AppendFileToBody)(PP_Resource request, |
81 PP_Resource file_ref, | 100 PP_Resource file_ref, |
82 int64_t start_offset, | 101 int64_t start_offset, |
83 int64_t number_of_bytes, | 102 int64_t number_of_bytes, |
84 PP_Time expected_last_modified_time); | 103 PP_Time expected_last_modified_time); |
85 }; | 104 }; |
| 105 /** |
| 106 * @} |
| 107 */ |
86 | 108 |
87 #endif /* PPAPI_C_PPB_URL_REQUEST_INFO_H_ */ | 109 #endif /* PPAPI_C_PPB_URL_REQUEST_INFO_H_ */ |
88 | 110 |
OLD | NEW |