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