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_DEV_PPB_URL_REQUEST_INFO_DEV_H_ | 5 #ifndef PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
6 #define PPAPI_C_DEV_PPB_URL_REQUEST_INFO_DEV_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_module.h" | 9 #include "ppapi/c/pp_module.h" |
10 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/pp_stdint.h" | 11 #include "ppapi/c/pp_stdint.h" |
12 #include "ppapi/c/pp_time.h" | 12 #include "ppapi/c/pp_time.h" |
13 | 13 |
14 struct PP_Var; | 14 struct PP_Var; |
15 | 15 |
16 typedef enum { | 16 typedef enum { |
17 PP_URLREQUESTPROPERTY_URL, // string | 17 PP_URLREQUESTPROPERTY_URL, // string |
18 PP_URLREQUESTPROPERTY_METHOD, // string | 18 PP_URLREQUESTPROPERTY_METHOD, // string |
19 PP_URLREQUESTPROPERTY_HEADERS, // string, \n-delim | 19 PP_URLREQUESTPROPERTY_HEADERS, // string, \n-delim |
20 PP_URLREQUESTPROPERTY_STREAMTOFILE, // PP_Bool (default=PP_FALSE) | 20 PP_URLREQUESTPROPERTY_STREAMTOFILE, // PP_Bool (default=PP_FALSE) |
21 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, // PP_Bool (default=PP_TRUE) | 21 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, // PP_Bool (default=PP_TRUE) |
22 | 22 |
23 // Set to true if you want to be able to poll the download progress via the | 23 // Set to true if you want to be able to poll the download progress via the |
24 // URLLoader.GetDownloadProgress function. | 24 // URLLoader.GetDownloadProgress function. |
25 // | 25 // |
26 // Boolean (default = PP_FALSE). | 26 // Boolean (default = PP_FALSE). |
27 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, | 27 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, |
28 | 28 |
29 // Set to true if you want to be able to pull the upload progress via the | 29 // Set to true if you want to be able to pull the upload progress via the |
30 // URLLoader.GetUploadProgress function. | 30 // URLLoader.GetUploadProgress function. |
31 // | 31 // |
32 // Boolean (default = PP_FALSE). | 32 // Boolean (default = PP_FALSE). |
33 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS | 33 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS |
| 34 } PP_URLRequestProperty; |
34 | 35 |
35 // TODO(darin): Add security/privacy options? | 36 #define PPB_URLREQUESTINFO_INTERFACE "PPB_URLRequestInfo;1" |
36 } PP_URLRequestProperty_Dev; | |
37 | 37 |
38 #define PPB_URLREQUESTINFO_DEV_INTERFACE "PPB_URLRequestInfo(Dev);0.2" | 38 struct PPB_URLRequestInfo { |
39 | |
40 struct PPB_URLRequestInfo_Dev { | |
41 // Create a new URLRequestInfo object. Returns 0 if the module is invalid. | 39 // Create a new URLRequestInfo object. Returns 0 if the module is invalid. |
42 PP_Resource (*Create)(PP_Module module); | 40 PP_Resource (*Create)(PP_Module module); |
43 | 41 |
44 // Returns PP_TRUE if the given resource is an URLRequestInfo. Returns | 42 // 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 | 43 // PP_FALSE if the resource is invalid or some type other than an |
46 // URLRequestInfo. | 44 // URLRequestInfo. |
47 PP_Bool (*IsURLRequestInfo)(PP_Resource resource); | 45 PP_Bool (*IsURLRequestInfo)(PP_Resource resource); |
48 | 46 |
49 // Sets a request property. Returns PP_FALSE if any of the parameters are | 47 // Sets a request property. Returns PP_FALSE if any of the parameters are |
50 // invalid, PP_TRUE on success. The value property must be the correct type | 48 // invalid, PP_TRUE on success. The value property must be the correct type |
51 // according to the property being set. | 49 // according to the property being set. |
52 PP_Bool (*SetProperty)(PP_Resource request, | 50 PP_Bool (*SetProperty)(PP_Resource request, |
53 PP_URLRequestProperty_Dev property, | 51 PP_URLRequestProperty property, |
54 struct PP_Var value); | 52 struct PP_Var value); |
55 | 53 |
56 // Append data to the request body. | 54 // Append data to the request body. |
57 // | 55 // |
58 // A Content-Length request header will be automatically generated. | 56 // A Content-Length request header will be automatically generated. |
59 // | 57 // |
60 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. | 58 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. |
61 PP_Bool (*AppendDataToBody)(PP_Resource request, | 59 PP_Bool (*AppendDataToBody)(PP_Resource request, |
62 const char* data, | 60 const char* data, |
63 uint32_t len); | 61 uint32_t len); |
(...skipping 13 matching lines...) Expand all Loading... |
77 // A Content-Length request header will be automatically generated. | 75 // A Content-Length request header will be automatically generated. |
78 // | 76 // |
79 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. | 77 // Returns PP_FALSE if any of the parameters are invalid, PP_TRUE on success. |
80 PP_Bool (*AppendFileToBody)(PP_Resource request, | 78 PP_Bool (*AppendFileToBody)(PP_Resource request, |
81 PP_Resource file_ref, | 79 PP_Resource file_ref, |
82 int64_t start_offset, | 80 int64_t start_offset, |
83 int64_t number_of_bytes, | 81 int64_t number_of_bytes, |
84 PP_Time expected_last_modified_time); | 82 PP_Time expected_last_modified_time); |
85 }; | 83 }; |
86 | 84 |
87 #endif // PPAPI_C_DEV_PPB_URL_REQUEST_INFO_DEV_H_ | 85 #endif // PPAPI_C_PPB_URL_REQUEST_INFO_H_ |
OLD | NEW |