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