Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / doc_generated / pepper_beta / c / struct_p_p_b___u_r_l_loader__1__0.html
1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>PPB_URLLoader Struct Reference</h1>
3 <div>
4 <!-- Generated by Doxygen 1.7.6.1 -->
5
6
7 </div>
8 <!--header-->
9 <div class="contents">
10 <!-- doxytag: class="PPB_URLLoader" --><h2>
11 Data Fields</h2><table class="memberdecls">
12
13 <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>
14 <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>
15 <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>
16 <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>
17 <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>
18 <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>
19 <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>
20 <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>
21 <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>
22 <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>
23 </table>
24 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
25 <div class="textblock"><p>The <b>PPB_URLLoader</b> interface contains pointers to functions for loading URLs. </p>
26 <p>The typical steps for loading a URL are:</p>
27 <ol type="1">
28 <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>
29 <li>Create a <code>URLRequestInfo</code> object and set properties on it. Refer to <code>PPB_URLRequestInfo</code> for further information.</li>
30 <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>
31 <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>
32 <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>
33 </ol>
34 <p>Alternatively, if <code>PP_URLREQUESTPROPERTY_STREAMTOFILE</code> was set on the <code>URLRequestInfo</code> in step #2:</p>
35 <ul>
36 <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>
37 <li>Then, access the downloaded file using the GetBodyAsFileRef() function of the <code>URLResponseInfo</code> returned in step #4. </li>
38 </ul>
39 </div><hr /><h2>Field Documentation</h2>
40 <a class="anchor" id="af96116176988be90bdee2619deff6e42"></a><!-- doxytag: member="PPB_URLLoader::Close" ref="af96116176988be90bdee2619deff6e42" args=")(PP_Resource loader)" -->
41 <div class="memitem">
42 <div class="memproto">
43 <table class="memname">
44 <tr>
45 <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>
46 </tr>
47 </table>
48 </div>
49 <div class="memdoc">
50 <p>Close is a pointer to a function used to cancel any pending IO and close the <code>URLLoader</code> object. </p>
51 <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>
52 <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>
53 <dl class="params"><dt><b>Parameters:</b></dt><dd>
54 <table class="params">
55 <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>
56 </table>
57 </dd>
58 </dl>
59 </div>
60 </div>
61 <a class="anchor" id="ab0ab892fe290ba6449d467db53fd4987"></a><!-- doxytag: member="PPB_URLLoader::Create" ref="ab0ab892fe290ba6449d467db53fd4987" args=")(PP_Instance instance)" -->
62 <div class="memitem">
63 <div class="memproto">
64 <table class="memname">
65 <tr>
66 <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>
67 </tr>
68 </table>
69 </div>
70 <div class="memdoc">
71 <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>
72 <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>
73 <dl class="params"><dt><b>Parameters:</b></dt><dd>
74 <table class="params">
75 <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>
76 </table>
77 </dd>
78 </dl>
79 <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>
80 </div>
81 </div>
82 <a class="anchor" id="a187774b3255231fa00ad1fe1364677ff"></a><!-- doxytag: member="PPB_URLLoader::FinishStreamingToFile" ref="a187774b3255231fa00ad1fe1364677ff" args=")(PP_Resource loader, struct PP_CompletionCallback callback)" -->
83 <div class="memitem">
84 <div class="memproto">
85 <table class="memname">
86 <tr>
87 <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>
88 </tr>
89 </table>
90 </div>
91 <div class="memdoc">
92 <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>
93 <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>
94 <dl class="params"><dt><b>Parameters:</b></dt><dd>
95 <table class="params">
96 <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>
97 <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>
98 </table>
99 </dd>
100 </dl>
101 <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>
102 </div>
103 </div>
104 <a class="anchor" id="a1932cf9779391f4d3efb4582ff49b0a6"></a><!-- doxytag: member="PPB_URLLoader::FollowRedirect" ref="a1932cf9779391f4d3efb4582ff49b0a6" args=")(PP_Resource loader, struct PP_CompletionCallback callback)" -->
105 <div class="memitem">
106 <div class="memproto">
107 <table class="memname">
108 <tr>
109 <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>
110 </tr>
111 </table>
112 </div>
113 <div class="memdoc">
114 <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>
115 <dl class="params"><dt><b>Parameters:</b></dt><dd>
116 <table class="params">
117 <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>
118 <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>
119 </table>
120 </dd>
121 </dl>
122 <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>
123 </div>
124 </div>
125 <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)" -->
126 <div class="memitem">
127 <div class="memproto">
128 <table class="memname">
129 <tr>
130 <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>
131 </tr>
132 </table>
133 </div>
134 <div class="memdoc">
135 <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>
136 <p>Progress only refers to the response body and does not include the headers.</p>
137 <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>
138 <dl class="params"><dt><b>Parameters:</b></dt><dd>
139 <table class="params">
140 <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>
141 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_received</td><td>The number of bytes received thus far. </td></tr>
142 <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>
143 </table>
144 </dd>
145 </dl>
146 <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>
147 </div>
148 </div>
149 <a class="anchor" id="a4901dcc43cfdc026e582555974d4d853"></a><!-- doxytag: member="PPB_URLLoader::GetResponseInfo" ref="a4901dcc43cfdc026e582555974d4d853" args=")(PP_Resource loader)" -->
150 <div class="memitem">
151 <div class="memproto">
152 <table class="memname">
153 <tr>
154 <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>
155 </tr>
156 </table>
157 </div>
158 <div class="memdoc">
159 <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>
160 <dl class="params"><dt><b>Parameters:</b></dt><dd>
161 <table class="params">
162 <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>
163 </table>
164 </dd>
165 </dl>
166 <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>
167 </div>
168 </div>
169 <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)" -->
170 <div class="memitem">
171 <div class="memproto">
172 <table class="memname">
173 <tr>
174 <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>
175 </tr>
176 </table>
177 </div>
178 <div class="memdoc">
179 <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>
180 <p>Progress only refers to the request body and does not include the headers.</p>
181 <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>
182 <dl class="params"><dt><b>Parameters:</b></dt><dd>
183 <table class="params">
184 <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>
185 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_sent</td><td>The number of bytes sent thus far. </td></tr>
186 <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>
187 </table>
188 </dd>
189 </dl>
190 <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>
191 </div>
192 </div>
193 <a class="anchor" id="a70db3876aed119140479e952cb7b1057"></a><!-- doxytag: member="PPB_URLLoader::IsURLLoader" ref="a70db3876aed119140479e952cb7b1057" args=")(PP_Resource resource)" -->
194 <div class="memitem">
195 <div class="memproto">
196 <table class="memname">
197 <tr>
198 <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>
199 </tr>
200 </table>
201 </div>
202 <div class="memdoc">
203 <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>
204 <dl class="params"><dt><b>Parameters:</b></dt><dd>
205 <table class="params">
206 <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>
207 </table>
208 </dd>
209 </dl>
210 <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>
211 </div>
212 </div>
213 <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)" -->
214 <div class="memitem">
215 <div class="memproto">
216 <table class="memname">
217 <tr>
218 <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>
219 </tr>
220 </table>
221 </div>
222 <div class="memdoc">
223 <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>
224 <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>
225 <dl class="params"><dt><b>Parameters:</b></dt><dd>
226 <table class="params">
227 <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>
228 <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>
229 <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>
230 </table>
231 </dd>
232 </dl>
233 <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>
234 </div>
235 </div>
236 <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)" -->
237 <div class="memitem">
238 <div class="memproto">
239 <table class="memname">
240 <tr>
241 <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>
242 </tr>
243 </table>
244 </div>
245 <div class="memdoc">
246 <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>
247 <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>
248 <dl class="params"><dt><b>Parameters:</b></dt><dd>
249 <table class="params">
250 <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>
251 <tr><td class="paramdir">[in,out]</td><td class="paramname">buffer</td><td>A pointer to the buffer for the response body. </td></tr>
252 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_to_read</td><td>The number of bytes to read. </td></tr>
253 <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>
254 </table>
255 </dd>
256 </dl>
257 <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>
258 </div>
259 </div>
260 <hr />The documentation for this struct was generated from the following file:<ul>
261 <li><a class="el" href="ppb__url__loader_8h.html">ppb_url_loader.h</a></li>
262 </ul>
263 </div><!-- contents -->
264 {{/partials.standard_nacl_article}}