blob: 9573323626fcb9b4812b73efa8811c8ba64e841e [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>pp::NetworkProxy Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::NetworkProxy" -->
<p><a href="classpp_1_1_network_proxy-members.html">List of all members.</a></p>
<h2>
Static Public Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_network_proxy.html#a864362732834af39e12f699ff5e1888d">IsAvailable</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_network_proxy.html#a03ae12454a920710272c15431039b6fd">GetProxyForURL</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance, const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;url, const <a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>&lt; <a class="el" href="classpp_1_1_var.html">Var</a> &gt; &amp;callback)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>This class provides a way to determine the appropriate proxy settings for for a given URL. </p>
<p>Permissions: Apps permission <code>socket</code> with subrule <code>resolve-proxy</code> is required for using this API. For more details about network communication permissions, please see: <a href="http://developer.chrome.com/apps/app_network.html">http://developer.chrome.com/apps/app_network.html</a> </p>
</div><hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="a03ae12454a920710272c15431039b6fd"></a><!-- doxytag: member="pp::NetworkProxy::GetProxyForURL" ref="a03ae12454a920710272c15431039b6fd" args="(const InstanceHandle &amp;instance, const Var &amp;url, const pp::CompletionCallbackWithOutput&lt; Var &gt; &amp;callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static int32_t <a class="el" href="classpp_1_1_network_proxy.html#a03ae12454a920710272c15431039b6fd">pp::NetworkProxy::GetProxyForURL</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
<td class="paramname"><em>instance</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_var.html">Var</a> &amp;&#160;</td>
<td class="paramname"><em>url</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback_with_output.html">pp::CompletionCallbackWithOutput</a>&lt; <a class="el" href="classpp_1_1_var.html">Var</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>callback</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Retrieves the proxy that will be used for the given URL. </p>
<p>The result will be a string in PAC format. For more details about PAC format, please see <a href="http://en.wikipedia.org/wiki/Proxy_auto-config">http://en.wikipedia.org/wiki/Proxy_auto-config</a></p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>An <code><a class="el" href="classpp_1_1_instance_handle.html" title="An instance handle identifies an instance in a constructor for a resource.">InstanceHandle</a></code> identifying one instance of a module.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">url</td><td>A string <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> containing a URL.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="classpp_1_1_completion_callback_with_output.html" title="A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to so...">CompletionCallbackWithOutput</a></code> to be called upon completion. It will be passed a string <code><a class="el" href="classpp_1_1_var.html" title="A generic type used for passing data types between the module and the page.">Var</a></code> containing the appropriate PAC string for <code>url</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a864362732834af39e12f699ff5e1888d"></a><!-- doxytag: member="pp::NetworkProxy::IsAvailable" ref="a864362732834af39e12f699ff5e1888d" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">static bool <a class="el" href="classpp_1_1_network_proxy.html#a864362732834af39e12f699ff5e1888d">pp::NetworkProxy::IsAvailable</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Returns true if the browser supports this API, false otherwise. </p>
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="network__proxy_8h.html">network_proxy.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}