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 */
5
6/* URL loader trusted interfaces. */
7
8[generate_thunk]
9
10label Chrome {
11  M14 = 0.3
12};
13
14/**
15 * Callback that indicates the status of the download and upload for the
16 * given URLLoader resource.
17 */
18typedef 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);
25
26/* Available only to trusted implementations. */
27interface PPB_URLLoaderTrusted {
28  /**
29   * Grant this URLLoader the capability to make unrestricted cross-origin
30   * requests.
31   */
32  void GrantUniversalAccess([in] PP_Resource loader);
33
34  /**
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.
39   *
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.
42   *
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.
46   */
47  void RegisterStatusCallback(
48      [in] PP_Resource loader,
49      [in] PP_URLLoaderTrusted_StatusCallback cb);
50};
51
52