| OLD | NEW |
| 1 /* Copyright (c) 2010 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 #ifndef PPAPI_C_PPB_URL_LOADER_TRUSTED_H_ | 5 |
| 6 #define PPAPI_C_PPB_URL_LOADER_TRUSTED_H_ | 6 /* From trusted/ppb_url_loader_trusted.idl modified Sat Jul 16 16:51:03 2011. */ |
| 7 |
| 8 #ifndef PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_ |
| 9 #define PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_ |
| 7 | 10 |
| 8 #include "ppapi/c/pp_instance.h" | 11 #include "ppapi/c/pp_instance.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 9 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
| 10 #include "ppapi/c/pp_stdint.h" | 14 #include "ppapi/c/pp_stdint.h" |
| 11 | 15 |
| 12 #define PPB_URLLOADERTRUSTED_INTERFACE "PPB_URLLoaderTrusted;0.3" | 16 /** |
| 17 * @file |
| 18 * URL loader trusted interfaces. */ |
| 13 | 19 |
| 14 // Callback that indicates the status of the download and upload for the | 20 |
| 15 // given URLLoader resource. | 21 /** |
| 22 * @addtogroup Typedefs |
| 23 * @{ |
| 24 */ |
| 25 /** |
| 26 * Callback that indicates the status of the download and upload for the |
| 27 * given URLLoader resource. |
| 28 */ |
| 16 typedef void (*PP_URLLoaderTrusted_StatusCallback)( | 29 typedef void (*PP_URLLoaderTrusted_StatusCallback)( |
| 17 PP_Instance pp_instance, | 30 PP_Instance pp_instance, |
| 18 PP_Resource pp_resource, | 31 PP_Resource pp_resource, |
| 19 int64_t bytes_sent, | 32 int64_t bytes_sent, |
| 20 int64_t total_bytes_to_be_sent, | 33 int64_t total_bytes_to_be_sent, |
| 21 int64_t bytes_received, | 34 int64_t bytes_received, |
| 22 int64_t total_bytes_to_be_received); | 35 int64_t total_bytes_to_be_received); |
| 36 /** |
| 37 * @} |
| 38 */ |
| 23 | 39 |
| 24 // Available only to trusted implementations. | 40 /** |
| 41 * @addtogroup Interfaces |
| 42 * @{ |
| 43 */ |
| 44 /* Available only to trusted implementations. */ |
| 45 #define PPB_URLLOADERTRUSTED_INTERFACE_0_3 "PPB_URLLoaderTrusted;0.3" |
| 46 #define PPB_URLLOADERTRUSTED_INTERFACE PPB_URLLOADERTRUSTED_INTERFACE_0_3 |
| 47 |
| 25 struct PPB_URLLoaderTrusted { | 48 struct PPB_URLLoaderTrusted { |
| 26 // Grant this URLLoader the capability to make unrestricted cross-origin | 49 /** |
| 27 // requests. | 50 * Grant this URLLoader the capability to make unrestricted cross-origin |
| 51 * requests. |
| 52 */ |
| 28 void (*GrantUniversalAccess)(PP_Resource loader); | 53 void (*GrantUniversalAccess)(PP_Resource loader); |
| 29 | 54 /** |
| 30 // Registers that the given function will be called when the upload or | 55 * Registers that the given function will be called when the upload or |
| 31 // downloaded byte count has changed. This is not exposed on the untrusted | 56 * downloaded byte count has changed. This is not exposed on the untrusted |
| 32 // interface because it can be quite chatty and encourages people to write | 57 * interface because it can be quite chatty and encourages people to write |
| 33 // feedback UIs that update as frequently as the progress updates. | 58 * feedback UIs that update as frequently as the progress updates. |
| 34 // | 59 * |
| 35 // The other serious gotcha with this callback is that the callback must not | 60 * The other serious gotcha with this callback is that the callback must not |
| 36 // mutate the URL loader or cause it to be destroyed. | 61 * mutate the URL loader or cause it to be destroyed. |
| 37 // | 62 * |
| 38 // However, the proxy layer needs this information to push to the other | 63 * However, the proxy layer needs this information to push to the other |
| 39 // process, so we expose it here. Only one callback can be set per URL | 64 * process, so we expose it here. Only one callback can be set per URL |
| 40 // Loader. Setting to a NULL callback will disable it. | 65 * Loader. Setting to a NULL callback will disable it. |
| 66 */ |
| 41 void (*RegisterStatusCallback)(PP_Resource loader, | 67 void (*RegisterStatusCallback)(PP_Resource loader, |
| 42 PP_URLLoaderTrusted_StatusCallback cb); | 68 PP_URLLoaderTrusted_StatusCallback cb); |
| 43 }; | 69 }; |
| 70 /** |
| 71 * @} |
| 72 */ |
| 44 | 73 |
| 45 #endif // PPAPI_C_PPB_URL_LOADER_H_ | 74 #endif /* PPAPI_C_TRUSTED_PPB_URL_LOADER_TRUSTED_H_ */ |
| 46 | 75 |
| OLD | NEW |