Skia roll 0b36e6b:fbe4136
[chromium-blink-merge.git] / ppapi / c / ppb_network_proxy.h
blob90a35b8f8dfaa29335274b63c8edd45d523291eb
1 /* Copyright 2013 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 ppb_network_proxy.idl modified Fri Jun 21 09:37:20 2013. */
8 #ifndef PPAPI_C_PPB_NETWORK_PROXY_H_
9 #define PPAPI_C_PPB_NETWORK_PROXY_H_
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_instance.h"
14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
18 #define PPB_NETWORKPROXY_INTERFACE_1_0 "PPB_NetworkProxy;1.0"
19 #define PPB_NETWORKPROXY_INTERFACE PPB_NETWORKPROXY_INTERFACE_1_0
21 /**
22 * @file
23 * This file defines the <code>PPB_NetworkProxy</code> interface.
27 /**
28 * @addtogroup Interfaces
29 * @{
31 /**
32 * This interface provides a way to determine the appropriate proxy settings
33 * for a given URL.
35 * Permissions: Apps permission <code>socket</code> with subrule
36 * <code>resolve-proxy</code> is required for using this API.
37 * For more details about network communication permissions, please see:
38 * http://developer.chrome.com/apps/app_network.html
40 struct PPB_NetworkProxy_1_0 {
41 /**
42 * Retrieves the proxy that will be used for the given URL. The result will
43 * be a string in PAC format. For more details about PAC format, please see
44 * http://en.wikipedia.org/wiki/Proxy_auto-config
46 * @param[in] instance A <code>PP_Instance</code> identifying one instance
47 * of a module.
49 * @param[in] url A string <code>PP_Var</code> containing a URL.
51 * @param[out] proxy_string A <code>PP_Var</code> that GetProxyForURL will
52 * set upon successful completion. If the call fails, <code>proxy_string
53 * </code> will be unchanged. Otherwise, it will be set to a string <code>
54 * PP_Var</code> containing the appropriate PAC string for <code>url</code>.
55 * If set, <code>proxy_string</code> will have a reference count of 1 which
56 * the plugin must manage.
58 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
59 * completion.
61 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
63 int32_t (*GetProxyForURL)(PP_Instance instance,
64 struct PP_Var url,
65 struct PP_Var* proxy_string,
66 struct PP_CompletionCallback callback);
69 typedef struct PPB_NetworkProxy_1_0 PPB_NetworkProxy;
70 /**
71 * @}
74 #endif /* PPAPI_C_PPB_NETWORK_PROXY_H_ */