blob: eb1f9ea605056381979537b4fb0d862e0d1482ed [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_URLLoader Struct 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="PPB_URLLoader" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#ab0ab892fe290ba6449d467db53fd4987">Create</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a70db3876aed119140479e952cb7b1057">IsURLLoader</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14">Open</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> request_info, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a1932cf9779391f4d3efb4582ff49b0a6">FollowRedirect</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#abb04744dfe5fce11e46c0e7e36c30b65">GetUploadProgress</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, int64_t *bytes_sent, int64_t *total_bytes_to_be_sent)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a3673506c6e0e23287b7d10e1163a0bbe">GetDownloadProgress</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, int64_t *bytes_received, int64_t *total_bytes_to_be_received)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a4901dcc43cfdc026e582555974d4d853">GetResponseInfo</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a92d0f2dc44bc4d087ad0ddca6557fb05">ReadResponseBody</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, void *buffer, int32_t bytes_to_read, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a187774b3255231fa00ad1fe1364677ff">FinishStreamingToFile</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#af96116176988be90bdee2619deff6e42">Close</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <b>PPB_URLLoader</b> interface contains pointers to functions for loading URLs. </p>
<p>The typical steps for loading a URL are:</p>
<ol type="1">
<li>Call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#ab0ab892fe290ba6449d467db53fd4987" title="Create() creates a new URLLoader object.">Create()</a> to create a URLLoader object.</li>
<li>Create a <code>URLRequestInfo</code> object and set properties on it. Refer to <code>PPB_URLRequestInfo</code> for further information.</li>
<li>Call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> with the <code>URLRequestInfo</code> as an argument.</li>
<li>When <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> completes, call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a4901dcc43cfdc026e582555974d4d853" title="GetResponseInfo() returns the current URLResponseInfo object.">GetResponseInfo()</a> to examine the response headers. Refer to <code>PPB_URLResponseInfo</code> for further information.</li>
<li>Call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a92d0f2dc44bc4d087ad0ddca6557fb05" title="ReadResponseBody() is used to read the response body.">ReadResponseBody()</a> to stream the data for the response.</li>
</ol>
<p>Alternatively, if <code>PP_URLREQUESTPROPERTY_STREAMTOFILE</code> was set on the <code>URLRequestInfo</code> in step #2:</p>
<ul>
<li>Call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a187774b3255231fa00ad1fe1364677ff" title="FinishStreamingToFile() is used to wait for the response body to be completely downloaded to the file...">FinishStreamingToFile()</a>, after examining the response headers (step #4), to wait for the downloaded file to be complete.</li>
<li>Then, access the downloaded file using the GetBodyAsFileRef() function of the <code>URLResponseInfo</code> returned in step #4. </li>
</ul>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="af96116176988be90bdee2619deff6e42"></a><!-- doxytag: member="PPB_URLLoader::Close" ref="af96116176988be90bdee2619deff6e42" args=")(PP_Resource loader)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#af96116176988be90bdee2619deff6e42">PPB_URLLoader::Close</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Close is a pointer to a function used to cancel any pending IO and close the <code>URLLoader</code> object. </p>
<p>Any pending callbacks will still run, reporting <code>PP_ERROR_ABORTED</code> if pending IO was interrupted. It is NOT valid to call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> again after a call to this function.</p>
<p><b>Note:</b> If the <code>URLLoader</code> object is destroyed while it is still open, then it will be implicitly closed so you are not required to call <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#af96116176988be90bdee2619deff6e42" title="Close is a pointer to a function used to cancel any pending IO and close the URLLoader object...">Close()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ab0ab892fe290ba6449d467db53fd4987"></a><!-- doxytag: member="PPB_URLLoader::Create" ref="ab0ab892fe290ba6449d467db53fd4987" args=")(PP_Instance instance)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#ab0ab892fe290ba6449d467db53fd4987">PPB_URLLoader::Create</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#ab0ab892fe290ba6449d467db53fd4987" title="Create() creates a new URLLoader object.">Create()</a> creates a new <code>URLLoader</code> object. </p>
<p>The <code>URLLoader</code> is associated with a particular instance, so that any UI dialogs that need to be shown to the user can be positioned relative to the window containing the instance.</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>A <code>PP_Instance</code> identifying one instance of a module.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> corresponding to a URLLoader if successful, 0 if the instance is invalid. </dd></dl>
</div>
</div>
<a class="anchor" id="a187774b3255231fa00ad1fe1364677ff"></a><!-- doxytag: member="PPB_URLLoader::FinishStreamingToFile" ref="a187774b3255231fa00ad1fe1364677ff" args=")(PP_Resource loader, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a187774b3255231fa00ad1fe1364677ff">PPB_URLLoader::FinishStreamingToFile</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a187774b3255231fa00ad1fe1364677ff" title="FinishStreamingToFile() is used to wait for the response body to be completely downloaded to the file...">FinishStreamingToFile()</a> is used to wait for the response body to be completely downloaded to the file provided by the GetBodyAsFileRef() in the current <code>URLResponseInfo</code>. </p>
<p>This function is only used if <code>PP_URLREQUESTPROPERTY_STREAMTOFILE</code> was set on the <code>URLRequestInfo</code> passed to <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to run on asynchronous completion. This callback will run when body is downloaded or an error occurs after <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a187774b3255231fa00ad1fe1364677ff" title="FinishStreamingToFile() is used to wait for the response body to be completely downloaded to the file...">FinishStreamingToFile()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing the number of bytes read or an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a1932cf9779391f4d3efb4582ff49b0a6"></a><!-- doxytag: member="PPB_URLLoader::FollowRedirect" ref="a1932cf9779391f4d3efb4582ff49b0a6" args=")(PP_Resource loader, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a1932cf9779391f4d3efb4582ff49b0a6">PPB_URLLoader::FollowRedirect</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a1932cf9779391f4d3efb4582ff49b0a6" title="FollowRedirect() can be invoked to follow a redirect after Open() completed on receiving redirect hea...">FollowRedirect()</a> can be invoked to follow a redirect after <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> completed on receiving redirect headers. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to run on asynchronous completion of <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a1932cf9779391f4d3efb4582ff49b0a6" title="FollowRedirect() can be invoked to follow a redirect after Open() completed on receiving redirect hea...">FollowRedirect()</a>. This callback will run when response headers for the redirect url are received or error occurred. This callback will only run if <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a1932cf9779391f4d3efb4582ff49b0a6" title="FollowRedirect() can be invoked to follow a redirect after Open() completed on receiving redirect hea...">FollowRedirect()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a3673506c6e0e23287b7d10e1163a0bbe"></a><!-- doxytag: member="PPB_URLLoader::GetDownloadProgress" ref="a3673506c6e0e23287b7d10e1163a0bbe" args=")(PP_Resource loader, int64_t *bytes_received, int64_t *total_bytes_to_be_received)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a3673506c6e0e23287b7d10e1163a0bbe">PPB_URLLoader::GetDownloadProgress</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, int64_t *bytes_received, int64_t *total_bytes_to_be_received)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a3673506c6e0e23287b7d10e1163a0bbe" title="GetDownloadProgress() returns the current download progress, which is meaningful after Open() has bee...">GetDownloadProgress()</a> returns the current download progress, which is meaningful after <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> has been called. </p>
<p>Progress only refers to the response body and does not include the headers.</p>
<p>This data is only available if the <code>URLRequestInfo</code> passed to <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> had the <code>PP_URLREQUESTPROPERTY_REPORTDOWNLOADPROGRESS</code> property set to <code>PP_TRUE</code>.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bytes_received</td><td>The number of bytes received thus far. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">total_bytes_to_be_received</td><td>The total number of bytes to be received. The total bytes to be received may be unknown, in which case <code>total_bytes_to_be_received</code> will be set to -1.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the download progress is available, <code>PP_FALSE</code> if it is not available. </dd></dl>
</div>
</div>
<a class="anchor" id="a4901dcc43cfdc026e582555974d4d853"></a><!-- doxytag: member="PPB_URLLoader::GetResponseInfo" ref="a4901dcc43cfdc026e582555974d4d853" args=")(PP_Resource loader)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a4901dcc43cfdc026e582555974d4d853">PPB_URLLoader::GetResponseInfo</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a4901dcc43cfdc026e582555974d4d853" title="GetResponseInfo() returns the current URLResponseInfo object.">GetResponseInfo()</a> returns the current <code>URLResponseInfo</code> object. </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>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> corresponding to the <code>URLResponseInfo</code> if successful, 0 if the loader is not a valid resource or if <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> has not been called. </dd></dl>
</div>
</div>
<a class="anchor" id="abb04744dfe5fce11e46c0e7e36c30b65"></a><!-- doxytag: member="PPB_URLLoader::GetUploadProgress" ref="abb04744dfe5fce11e46c0e7e36c30b65" args=")(PP_Resource loader, int64_t *bytes_sent, int64_t *total_bytes_to_be_sent)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#abb04744dfe5fce11e46c0e7e36c30b65">PPB_URLLoader::GetUploadProgress</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, int64_t *bytes_sent, int64_t *total_bytes_to_be_sent)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#abb04744dfe5fce11e46c0e7e36c30b65" title="GetUploadProgress() returns the current upload progress (which is meaningful after Open() has been ca...">GetUploadProgress()</a> returns the current upload progress (which is meaningful after <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> has been called). </p>
<p>Progress only refers to the request body and does not include the headers.</p>
<p>This data is only available if the <code>URLRequestInfo</code> passed to <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> had the <code>PP_URLREQUESTPROPERTY_REPORTUPLOADPROGRESS</code> property set to PP_TRUE.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bytes_sent</td><td>The number of bytes sent thus far. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">total_bytes_to_be_sent</td><td>The total number of bytes to be sent.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the upload progress is available, <code>PP_FALSE</code> if it is not available. </dd></dl>
</div>
</div>
<a class="anchor" id="a70db3876aed119140479e952cb7b1057"></a><!-- doxytag: member="PPB_URLLoader::IsURLLoader" ref="a70db3876aed119140479e952cb7b1057" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a70db3876aed119140479e952cb7b1057">PPB_URLLoader::IsURLLoader</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a70db3876aed119140479e952cb7b1057" title="IsURLLoader() determines if a resource is an URLLoader.">IsURLLoader()</a> determines if a resource is an <code>URLLoader</code>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the resource is a <code>URLLoader</code>, <code>PP_FALSE</code> if the resource is invalid or some type other than <code>URLLoader</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a5e7fca398c1042e2c81211da80d20e14"></a><!-- doxytag: member="PPB_URLLoader::Open" ref="a5e7fca398c1042e2c81211da80d20e14" args=")(PP_Resource loader, PP_Resource request_info, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14">PPB_URLLoader::Open</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, <a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> request_info, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> begins loading the <code>URLRequestInfo</code>. </p>
<p>The operation completes when response headers are received or when an error occurs. Use <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a4901dcc43cfdc026e582555974d4d853" title="GetResponseInfo() returns the current URLResponseInfo object.">GetResponseInfo()</a> to access the response headers.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a <code>URLRequestInfo</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to run on asynchronous completion of <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a>. This callback will run when response headers for the url are received or error occurred. This callback will only run if <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a5e7fca398c1042e2c81211da80d20e14" title="Open() begins loading the URLRequestInfo.">Open()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a92d0f2dc44bc4d087ad0ddca6557fb05"></a><!-- doxytag: member="PPB_URLLoader::ReadResponseBody" ref="a92d0f2dc44bc4d087ad0ddca6557fb05" args=")(PP_Resource loader, void *buffer, int32_t bytes_to_read, struct PP_CompletionCallback callback)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t(* <a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a92d0f2dc44bc4d087ad0ddca6557fb05">PPB_URLLoader::ReadResponseBody</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> loader, void *buffer, int32_t bytes_to_read, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___u_r_l_loader__1__0.html#a92d0f2dc44bc4d087ad0ddca6557fb05" title="ReadResponseBody() is used to read the response body.">ReadResponseBody()</a> is used to read the response body. </p>
<p>The size of the buffer must be large enough to hold the specified number of bytes to read. This function might perform a partial read.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">loader</td><td>A <code>PP_Resource</code> corresponding to a <code>URLLoader</code>. </td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">buffer</td><td>A pointer to the buffer for the response body. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">bytes_to_read</td><td>The number of bytes to read. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to run on asynchronous completion. The callback will run if the bytes (full or partial) are read or an error occurs asynchronously. This callback will run only if this function returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing the number of bytes read or an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. </dd></dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__url__loader_8h.html">ppb_url_loader.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}