| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_C_DEV_PPB_URL_LOADER_TRUSTED_DEV_H_ | |
| 6 #define PPAPI_C_DEV_PPB_URL_LOADER_TRUSTED_DEV_H_ | |
| 7 | |
| 8 #include "ppapi/c/pp_instance.h" | |
| 9 #include "ppapi/c/pp_resource.h" | |
| 10 #include "ppapi/c/pp_stdint.h" | |
| 11 | |
| 12 #define PPB_URLLOADERTRUSTED_DEV_INTERFACE "PPB_URLLoaderTrusted(Dev);0.2" | |
| 13 | |
| 14 // Callback that indicates the status of the download and upload for the | |
| 15 // given URLLoader resource. | |
| 16 typedef void (*PP_URLLoaderTrusted_StatusCallback)( | |
| 17 PP_Instance pp_instance, | |
| 18 PP_Resource pp_resource, | |
| 19 int64_t bytes_sent, | |
| 20 int64_t total_bytes_to_be_sent, | |
| 21 int64_t bytes_received, | |
| 22 int64_t total_bytes_to_be_received); | |
| 23 | |
| 24 // Available only to trusted implementations. | |
| 25 struct PPB_URLLoaderTrusted_Dev { | |
| 26 // Grant this URLLoader the capability to make unrestricted cross-origin | |
| 27 // requests. | |
| 28 void (*GrantUniversalAccess)(PP_Resource loader); | |
| 29 | |
| 30 // 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 | |
| 32 // interface because it can be quite chatty and encourages people to write | |
| 33 // feedback UIs that update as frequently as the progress updates. | |
| 34 // | |
| 35 // The other serious gotcha with this callback is that the callback must not | |
| 36 // mutate the URL loader or cause it to be destroyed. | |
| 37 // | |
| 38 // 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 | |
| 40 // Loader. Setting to a NULL callback will disable it. | |
| 41 void (*RegisterStatusCallback)(PP_Resource loader, | |
| 42 PP_URLLoaderTrusted_StatusCallback cb); | |
| 43 }; | |
| 44 | |
| 45 #endif // PPAPI_C_DEV_PPB_URL_LOADER_DEV_H_ | |
| OLD | NEW |