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.
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
23 * This file defines the <code>PPB_NetworkProxy</code> interface.
28 * @addtogroup Interfaces
32 * This interface provides a way to determine the appropriate proxy settings
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
{
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
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
61 * @return An int32_t containing an error code from <code>pp_errors.h</code>.
63 int32_t (*GetProxyForURL
)(PP_Instance instance
,
65 struct PP_Var
* proxy_string
,
66 struct PP_CompletionCallback callback
);
69 typedef struct PPB_NetworkProxy_1_0 PPB_NetworkProxy
;
74 #endif /* PPAPI_C_PPB_NETWORK_PROXY_H_ */