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.
6 /* URL loader trusted interfaces. */
13 * Callback that indicates the status of the download and upload for the
14 * given URLLoader resource.
16 typedef void PP_URLLoaderTrusted_StatusCallback
(
17 [in] PP_Instance pp_instance
,
18 [in] PP_Resource pp_resource
,
19 [in] int64_t bytes_sent
,
20 [in] int64_t total_bytes_to_be_sent
,
21 [in] int64_t bytes_received
,
22 [in] int64_t total_bytes_to_be_received
);
24 /* Available only to trusted implementations. */
25 interface PPB_URLLoaderTrusted
{
27 * Grant this URLLoader the capability to make unrestricted cross-origin
30 void GrantUniversalAccess
([in] PP_Resource loader
);
33 * Registers that the given function will be called when the upload or
34 * downloaded byte count has changed. This is not exposed on the untrusted
35 * interface because it can be quite chatty and encourages people to write
36 * feedback UIs that update as frequently as the progress updates.
38 * The other serious gotcha with this callback is that the callback must not
39 * mutate the URL loader or cause it to be destroyed.
41 * However, the proxy layer needs this information to push to the other
42 * process, so we expose it here. Only one callback can be set per URL
43 * Loader. Setting to a NULL callback will disable it.
45 void RegisterStatusCallback
(
46 [in] PP_Resource loader
,
47 [in] PP_URLLoaderTrusted_StatusCallback cb
);