| 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 |
| 11 label Chrome { | 11 label Chrome { |
| 12 M14 = 1.0 | 12 M14 = 1.0 |
| 13 }; | 13 }; |
| 14 | 14 |
| 15 /** | 15 /** |
| 16 * This enumeration contains properties that can be set on a URL request. | 16 * This enumeration contains properties that can be set on a URL request. |
| 17 */ | 17 */ |
| 18 [assert_size(4)] | 18 [assert_size(4)] |
| 19 enum PP_URLRequestProperty { | 19 enum PP_URLRequestProperty { |
| 20 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ | 20 /** This corresponds to a string (<code>PP_VARTYPE_STRING</code>). */ |
| 21 PP_URLREQUESTPROPERTY_URL, | 21 PP_URLREQUESTPROPERTY_URL = 0, |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>); either | 24 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>); either |
| 25 * POST or GET. Refer to the | 25 * POST or GET. Refer to the |
| 26 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html">HTTP | 26 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html">HTTP |
| 27 * Methods</a> documentation for further information. | 27 * Methods</a> documentation for further information. |
| 28 * | 28 * |
| 29 */ | 29 */ |
| 30 PP_URLREQUESTPROPERTY_METHOD, | 30 PP_URLREQUESTPROPERTY_METHOD = 1, |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>); \n | 33 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>); \n |
| 34 * delimited. Refer to the | 34 * delimited. Refer to the |
| 35 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"Header | 35 * <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html"Header |
| 36 * Field Definitions</a> documentaiton for further information. | 36 * Field Definitions</a> documentaiton for further information. |
| 37 */ | 37 */ |
| 38 PP_URLREQUESTPROPERTY_HEADERS, | 38 PP_URLREQUESTPROPERTY_HEADERS = 2, |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; | 41 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; |
| 42 * default=<code>PP_FALSE</code>). | 42 * default=<code>PP_FALSE</code>). |
| 43 * Set this value to <code>PP_TRUE</code> if you want to download the data | 43 * Set this value to <code>PP_TRUE</code> if you want to download the data |
| 44 * to a file. Use PPB_URLLoader.FinishStreamingToFile() to complete the | 44 * to a file. Use PPB_URLLoader.FinishStreamingToFile() to complete the |
| 45 * download. | 45 * download. |
| 46 */ | 46 */ |
| 47 PP_URLREQUESTPROPERTY_STREAMTOFILE, | 47 PP_URLREQUESTPROPERTY_STREAMTOFILE = 3, |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; | 50 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; |
| 51 * default=<code>PP_TRUE</code>). | 51 * default=<code>PP_TRUE</code>). |
| 52 * Set this value to <code>PP_FALSE</code> if you want to use | 52 * Set this value to <code>PP_FALSE</code> if you want to use |
| 53 * PPB_URLLoader.FollowRedirects() to follow the redirects only after | 53 * PPB_URLLoader.FollowRedirects() to follow the redirects only after |
| 54 * examining redirect headers. | 54 * examining redirect headers. |
| 55 */ | 55 */ |
| 56 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS, | 56 PP_URLREQUESTPROPERTY_FOLLOWREDIRECTS = 4, |
| 57 | 57 |
| 58 /** | 58 /** |
| 59 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; | 59 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; |
| 60 * default=<code>PP_FALSE</code>). | 60 * default=<code>PP_FALSE</code>). |
| 61 * Set this value to <code>PP_TRUE</code> if you want to be able to poll the | 61 * Set this value to <code>PP_TRUE</code> if you want to be able to poll the |
| 62 * download progress using PPB_URLLoader.GetDownloadProgress(). | 62 * download progress using PPB_URLLoader.GetDownloadProgress(). |
| 63 */ | 63 */ |
| 64 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS, | 64 PP_URLREQUESTPROPERTY_RECORDDOWNLOADPROGRESS = 5, |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * This corresponds to a <code>PP_Bool</code> | 67 * This corresponds to a <code>PP_Bool</code> |
| 68 * (default=<code>PP_FALSE</code>). Set this value to <code>PP_TRUE</code> if | 68 * (default=<code>PP_FALSE</code>). Set this value to <code>PP_TRUE</code> if |
| 69 * you want to be able to poll the upload progress using | 69 * you want to be able to poll the upload progress using |
| 70 * PPB_URLLoader.GetUplaodProgress(). | 70 * PPB_URLLoader.GetUplaodProgress(). |
| 71 */ | 71 */ |
| 72 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS, | 72 PP_URLREQUESTPROPERTY_RECORDUPLOADPROGRESS = 6, |
| 73 | 73 |
| 74 /** | 74 /** |
| 75 * This corresponds to a string (<code>PP_VARTYPE_STRING)</code> or may be | 75 * This corresponds to a string (<code>PP_VARTYPE_STRING)</code> or may be |
| 76 * undefined (<code>PP_VARTYPE_UNDEFINED</code>; default). | 76 * undefined (<code>PP_VARTYPE_UNDEFINED</code>; default). |
| 77 * Set it to a string to set a custom referrer (if empty, the referrer header | 77 * Set it to a string to set a custom referrer (if empty, the referrer header |
| 78 * will be omitted), or to undefined to use the default referrer. Only loaders | 78 * will be omitted), or to undefined to use the default referrer. Only loaders |
| 79 * with universal access (only available on trusted implementations) will | 79 * with universal access (only available on trusted implementations) will |
| 80 * accept <code>URLRequestInfo</code> objects that try to set a custom | 80 * accept <code>URLRequestInfo</code> objects that try to set a custom |
| 81 * referrer; if given to a loader without universal access, | 81 * referrer; if given to a loader without universal access, |
| 82 * <code>PP_ERROR_NOACCESS</code> will result. | 82 * <code>PP_ERROR_NOACCESS</code> will result. |
| 83 */ | 83 */ |
| 84 PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL, | 84 PP_URLREQUESTPROPERTY_CUSTOMREFERRERURL = 7, |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; | 87 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; |
| 88 * default=<code>PP_FALSE</code>). Whether cross-origin requests are allowed. | 88 * default=<code>PP_FALSE</code>). Whether cross-origin requests are allowed. |
| 89 * Cross-origin requests are made using the CORS (Cross-Origin Resource | 89 * Cross-origin requests are made using the CORS (Cross-Origin Resource |
| 90 * Sharing) algorithm to check whether the request should be allowed. For the | 90 * Sharing) algorithm to check whether the request should be allowed. For the |
| 91 * complete CORS algorithm, refer to | 91 * complete CORS algorithm, refer to |
| 92 * the <a href="http://www.w3.org/TR/access-control">Cross-Origin Resource | 92 * the <a href="http://www.w3.org/TR/access-control">Cross-Origin Resource |
| 93 * Sharing</a> documentation. | 93 * Sharing</a> documentation. |
| 94 */ | 94 */ |
| 95 PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS, | 95 PP_URLREQUESTPROPERTY_ALLOWCROSSORIGINREQUESTS = 8, |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; | 98 * This corresponds to a <code>PP_Bool</code> (<code>PP_VARTYPE_BOOL</code>; |
| 99 * default=<code>PP_FALSE</code>). | 99 * default=<code>PP_FALSE</code>). |
| 100 * Whether HTTP credentials are sent with cross-origin requests. If false, | 100 * Whether HTTP credentials are sent with cross-origin requests. If false, |
| 101 * no credentials are sent with the request and cookies are ignored in the | 101 * no credentials are sent with the request and cookies are ignored in the |
| 102 * response. If the request is not cross-origin, this property is ignored. | 102 * response. If the request is not cross-origin, this property is ignored. |
| 103 */ | 103 */ |
| 104 PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS, | 104 PP_URLREQUESTPROPERTY_ALLOWCREDENTIALS = 9, |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>) or may be | 107 * This corresponds to a string (<code>PP_VARTYPE_STRING</code>) or may be |
| 108 * undefined (<code>PP_VARTYPE_UNDEFINED</code>; default). | 108 * undefined (<code>PP_VARTYPE_UNDEFINED</code>; default). |
| 109 * Set it to a string to set a custom content-transfer-encoding header (if | 109 * Set it to a string to set a custom content-transfer-encoding header (if |
| 110 * empty, that header will be omitted), or to undefined to use the default | 110 * empty, that header will be omitted), or to undefined to use the default |
| 111 * (if any). Only loaders with universal access (only available on trusted | 111 * (if any). Only loaders with universal access (only available on trusted |
| 112 * implementations) will accept <code>URLRequestInfo</code> objects that try | 112 * implementations) will accept <code>URLRequestInfo</code> objects that try |
| 113 * to set a custom content transfer encoding; if given to a loader without | 113 * to set a custom content transfer encoding; if given to a loader without |
| 114 * universal access, <code>PP_ERROR_NOACCESS</code> will result. | 114 * universal access, <code>PP_ERROR_NOACCESS</code> will result. |
| 115 */ | 115 */ |
| 116 PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING, | 116 PP_URLREQUESTPROPERTY_CUSTOMCONTENTTRANSFERENCODING = 10, |
| 117 | 117 |
| 118 /** | 118 /** |
| 119 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>); default | 119 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>); default |
| 120 * is not defined and is set by the browser, possibly depending on system | 120 * is not defined and is set by the browser, possibly depending on system |
| 121 * capabilities. Set it to an integer to set an upper threshold for the | 121 * capabilities. Set it to an integer to set an upper threshold for the |
| 122 * prefetched buffer of an asynchronous load. When exceeded, the browser will | 122 * prefetched buffer of an asynchronous load. When exceeded, the browser will |
| 123 * defer loading until | 123 * defer loading until |
| 124 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> is hit, | 124 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> is hit, |
| 125 * at which time it will begin prefetching again. When setting this property, | 125 * at which time it will begin prefetching again. When setting this property, |
| 126 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> must also | 126 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> must also |
| 127 * be set. Behavior is undefined if the former is <= the latter. | 127 * be set. Behavior is undefined if the former is <= the latter. |
| 128 */ | 128 */ |
| 129 PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD, | 129 PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD = 11, |
| 130 | 130 |
| 131 /** | 131 /** |
| 132 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>); default is | 132 * This corresponds to an integer (<code>PP_VARTYPE_INT32</code>); default is |
| 133 * not defined and is set by the browser to a value appropriate for the | 133 * not defined and is set by the browser to a value appropriate for the |
| 134 * default <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD</code>. | 134 * default <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD</code>. |
| 135 * Set it to an integer to set a lower threshold for the prefetched buffer | 135 * Set it to an integer to set a lower threshold for the prefetched buffer |
| 136 * of an asynchronous load. When reached, the browser will resume loading if | 136 * of an asynchronous load. When reached, the browser will resume loading if |
| 137 * If <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> had | 137 * If <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERERTHRESHOLD</code> had |
| 138 * previously been reached. | 138 * previously been reached. |
| 139 * When setting this property, | 139 * When setting this property, |
| 140 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD</code> must also | 140 * <code>PP_URLREQUESTPROPERTY_PREFETCHBUFFERUPPERTHRESHOLD</code> must also |
| 141 * be set. Behavior is undefined if the former is >= the latter. | 141 * be set. Behavior is undefined if the former is >= the latter. |
| 142 */ | 142 */ |
| 143 PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD | 143 PP_URLREQUESTPROPERTY_PREFETCHBUFFERLOWERTHRESHOLD = 12 |
| 144 }; | 144 }; |
| 145 | 145 |
| 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 /** |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |