Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / doc_generated / pepper_beta / cpp / classpp_1_1_u_r_l_loader.html
1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>pp::URLLoader Class Reference</h1>
3 <div>
4 <!-- Generated by Doxygen 1.7.6.1 -->
5
6
7
8 </div>
9 <!--header-->
10 <div class="contents">
11 <!-- doxytag: class="pp::URLLoader" --><!-- doxytag: inherits="pp::Resource" --><div class="dynheader">
12 Inheritance diagram for pp::URLLoader:</div>
13 <div class="dyncontent">
14 <div class="center"><img src="classpp_1_1_u_r_l_loader__inherit__graph.png" border="0" usemap="#pp_1_1_u_r_l_loader_inherit__map" alt="Inheritance graph" /></div>
15 <map name="pp_1_1_u_r_l_loader_inherit__map" id="pp_1_1_u_r_l_loader_inherit__map">
16 <area shape="rect" id="node2" href="classpp_1_1_resource.html" title="A reference counted module resource." alt="" coords="11,5,115,35"></area></map>
17 <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
18 <p><a href="classpp_1_1_u_r_l_loader-members.html">List of all members.</a></p>
19 <h2>
20 Public Member Functions</h2><table class="memberdecls">
21
22 <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a22b752c975a9302efa2eceb20ecf92ed">URLLoader</a> ()</td></tr>
23 <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a187f5a2c8422c072c2a33bca4de9e39d">URLLoader</a> (PP_Resource resource)</td></tr>
24 <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a806606ad9e924708b69ae124b4c9d97d">URLLoader</a> (const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;instance)</td></tr>
25 <tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#ac590ce0a1992376bcf154c4e3cce1ab2">URLLoader</a> (const <a class="el" href="classpp_1_1_u_r_l_loader.html">URLLoader</a> &amp;other)</td></tr>
26 <tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8">Open</a> (const <a class="el" href="classpp_1_1_u_r_l_request_info.html">URLRequestInfo</a> &amp;request_info, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
27 <tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a411a79d6e9e5335ce31d187d137420af">FollowRedirect</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
28 <tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a5e3723f5c5d10394329899f75121faf1">GetUploadProgress</a> (int64_t *bytes_sent, int64_t *total_bytes_to_be_sent) const </td></tr>
29 <tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#ada4a1757e7883912626e2ece85ec1c53">GetDownloadProgress</a> (int64_t *bytes_received, int64_t *total_bytes_to_be_received) const </td></tr>
30 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_u_r_l_response_info.html">URLResponseInfo</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a92757c9e1261280cb4f8fd65e0c8df6f">GetResponseInfo</a> () const </td></tr>
31 <tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a907697c3c268a68eb3b4ca341aea4812">ReadResponseBody</a> (void *buffer, int32_t bytes_to_read, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
32 <tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a2e40e91e7a9ffca3f697497abef843f4">FinishStreamingToFile</a> (const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;cc)</td></tr>
33 <tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_u_r_l_loader.html#a43858cb7d3c64dc37128434e18a2ea1c">Close</a> ()</td></tr>
34 </table>
35 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
36 <div class="textblock"><p><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a> provides an API for loading URLs. </p>
37 <p>Refer to <code>ppapi/examples/url_loader/streaming.cc</code> for an example of how to use this class. </p>
38 </div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
39 <a class="anchor" id="a22b752c975a9302efa2eceb20ecf92ed"></a><!-- doxytag: member="pp::URLLoader::URLLoader" ref="a22b752c975a9302efa2eceb20ecf92ed" args="()" -->
40 <div class="memitem">
41 <div class="memproto">
42 <table class="memname">
43 <tr>
44 <td class="memname"><a class="el" href="classpp_1_1_u_r_l_loader.html#a22b752c975a9302efa2eceb20ecf92ed">pp::URLLoader::URLLoader</a> </td>
45 <td>(</td>
46 <td class="paramname"></td><td>)</td>
47 <td><code> [inline]</code></td>
48 </tr>
49 </table>
50 </div>
51 <div class="memdoc">
52 <p>Default constructor for creating an <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9" title="This functions determines if this resource is invalid or uninitialized.">is_null()</a> <code><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a></code> object. </p>
53 </div>
54 </div>
55 <a class="anchor" id="a187f5a2c8422c072c2a33bca4de9e39d"></a><!-- doxytag: member="pp::URLLoader::URLLoader" ref="a187f5a2c8422c072c2a33bca4de9e39d" args="(PP_Resource resource)" -->
56 <div class="memitem">
57 <div class="memproto">
58 <table class="memname">
59 <tr>
60 <td class="memname"><a class="el" href="classpp_1_1_u_r_l_loader.html#a22b752c975a9302efa2eceb20ecf92ed">pp::URLLoader::URLLoader</a> </td>
61 <td>(</td>
62 <td class="paramtype">PP_Resource&#160;</td>
63 <td class="paramname"><em>resource</em></td><td>)</td>
64 <td><code> [explicit]</code></td>
65 </tr>
66 </table>
67 </div>
68 <div class="memdoc">
69 <p>A constructor used when a <code>PP_Resource</code> is provided as a return value whose reference count we need to increment. </p>
70 <dl class="params"><dt><b>Parameters:</b></dt><dd>
71 <table class="params">
72 <tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a <code><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a></code> resource. </td></tr>
73 </table>
74 </dd>
75 </dl>
76 </div>
77 </div>
78 <a class="anchor" id="a806606ad9e924708b69ae124b4c9d97d"></a><!-- doxytag: member="pp::URLLoader::URLLoader" ref="a806606ad9e924708b69ae124b4c9d97d" args="(const InstanceHandle &amp;instance)" -->
79 <div class="memitem">
80 <div class="memproto">
81 <table class="memname">
82 <tr>
83 <td class="memname"><a class="el" href="classpp_1_1_u_r_l_loader.html#a22b752c975a9302efa2eceb20ecf92ed">pp::URLLoader::URLLoader</a> </td>
84 <td>(</td>
85 <td class="paramtype">const <a class="el" href="classpp_1_1_instance_handle.html">InstanceHandle</a> &amp;&#160;</td>
86 <td class="paramname"><em>instance</em></td><td>)</td>
87 <td><code> [explicit]</code></td>
88 </tr>
89 </table>
90 </div>
91 <div class="memdoc">
92 <p>A constructor used to allocate a new <a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a> in the browser. </p>
93 <p>The resulting object will be <code>is_null</code> if the allocation failed.</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">instance</td><td>The instance with which this resource will be associated. </td></tr>
97 </table>
98 </dd>
99 </dl>
100 </div>
101 </div>
102 <a class="anchor" id="ac590ce0a1992376bcf154c4e3cce1ab2"></a><!-- doxytag: member="pp::URLLoader::URLLoader" ref="ac590ce0a1992376bcf154c4e3cce1ab2" args="(const URLLoader &amp;other)" -->
103 <div class="memitem">
104 <div class="memproto">
105 <table class="memname">
106 <tr>
107 <td class="memname"><a class="el" href="classpp_1_1_u_r_l_loader.html#a22b752c975a9302efa2eceb20ecf92ed">pp::URLLoader::URLLoader</a> </td>
108 <td>(</td>
109 <td class="paramtype">const <a class="el" href="classpp_1_1_u_r_l_loader.html">URLLoader</a> &amp;&#160;</td>
110 <td class="paramname"><em>other</em></td><td>)</td>
111 <td></td>
112 </tr>
113 </table>
114 </div>
115 <div class="memdoc">
116 <p>The copy constructor for <code><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a></code>. </p>
117 <dl class="params"><dt><b>Parameters:</b></dt><dd>
118 <table class="params">
119 <tr><td class="paramname">other</td><td>A <code><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a></code> to be copied. </td></tr>
120 </table>
121 </dd>
122 </dl>
123 </div>
124 </div>
125 <hr /><h2>Member Function Documentation</h2>
126 <a class="anchor" id="a43858cb7d3c64dc37128434e18a2ea1c"></a><!-- doxytag: member="pp::URLLoader::Close" ref="a43858cb7d3c64dc37128434e18a2ea1c" args="()" -->
127 <div class="memitem">
128 <div class="memproto">
129 <table class="memname">
130 <tr>
131 <td class="memname">void <a class="el" href="classpp_1_1_u_r_l_loader.html#a43858cb7d3c64dc37128434e18a2ea1c">pp::URLLoader::Close</a> </td>
132 <td>(</td>
133 <td class="paramname"></td><td>)</td>
134 <td></td>
135 </tr>
136 </table>
137 </div>
138 <div class="memdoc">
139 <p>This function is used to cancel any pending IO and close the <a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a> object. </p>
140 <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="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> again after a call to this function.</p>
141 <p><b>Note:</b> If the <code><a class="el" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs.">URLLoader</a></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="classpp_1_1_u_r_l_loader.html#a43858cb7d3c64dc37128434e18a2ea1c" title="This function is used to cancel any pending IO and close the URLLoader object.">Close()</a>. </p>
142 </div>
143 </div>
144 <a class="anchor" id="a2e40e91e7a9ffca3f697497abef843f4"></a><!-- doxytag: member="pp::URLLoader::FinishStreamingToFile" ref="a2e40e91e7a9ffca3f697497abef843f4" args="(const CompletionCallback &amp;cc)" -->
145 <div class="memitem">
146 <div class="memproto">
147 <table class="memname">
148 <tr>
149 <td class="memname">int32_t <a class="el" href="classpp_1_1_u_r_l_loader.html#a2e40e91e7a9ffca3f697497abef843f4">pp::URLLoader::FinishStreamingToFile</a> </td>
150 <td>(</td>
151 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
152 <td class="paramname"><em>cc</em></td><td>)</td>
153 <td></td>
154 </tr>
155 </table>
156 </div>
157 <div class="memdoc">
158 <p>This function is used to wait for the response body to be completely downloaded to the file provided by the GetBodyAsFileRef() in the current <code><a class="el" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses.">URLResponseInfo</a></code>. </p>
159 <p>This function is only used if <code>PP_URLREQUESTPROPERTY_STREAMTOFILE</code> was set on the <code><a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a></code> passed to <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a>.</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">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">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="classpp_1_1_u_r_l_loader.html#a2e40e91e7a9ffca3f697497abef843f4" title="This function is used to wait for the response body to be completely downloaded to the file provided ...">FinishStreamingToFile()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
163 </table>
164 </dd>
165 </dl>
166 <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing the number of bytes read or an error code from <code>pp_errors.h</code>. </dd></dl>
167 </div>
168 </div>
169 <a class="anchor" id="a411a79d6e9e5335ce31d187d137420af"></a><!-- doxytag: member="pp::URLLoader::FollowRedirect" ref="a411a79d6e9e5335ce31d187d137420af" args="(const CompletionCallback &amp;cc)" -->
170 <div class="memitem">
171 <div class="memproto">
172 <table class="memname">
173 <tr>
174 <td class="memname">int32_t <a class="el" href="classpp_1_1_u_r_l_loader.html#a411a79d6e9e5335ce31d187d137420af">pp::URLLoader::FollowRedirect</a> </td>
175 <td>(</td>
176 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
177 <td class="paramname"><em>cc</em></td><td>)</td>
178 <td></td>
179 </tr>
180 </table>
181 </div>
182 <div class="memdoc">
183 <p>This function can be invoked to follow a redirect after <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> completed on receiving redirect headers. </p>
184 <dl class="params"><dt><b>Parameters:</b></dt><dd>
185 <table class="params">
186 <tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to run on asynchronous completion of <a class="el" href="classpp_1_1_u_r_l_loader.html#a411a79d6e9e5335ce31d187d137420af" title="This function can be invoked to follow a redirect after Open() completed on receiving redirect header...">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="classpp_1_1_u_r_l_loader.html#a411a79d6e9e5335ce31d187d137420af" title="This function can be invoked to follow a redirect after Open() completed on receiving redirect header...">FollowRedirect()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
187 </table>
188 </dd>
189 </dl>
190 <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
191 </div>
192 </div>
193 <a class="anchor" id="ada4a1757e7883912626e2ece85ec1c53"></a><!-- doxytag: member="pp::URLLoader::GetDownloadProgress" ref="ada4a1757e7883912626e2ece85ec1c53" args="(int64_t *bytes_received, int64_t *total_bytes_to_be_received) const " -->
194 <div class="memitem">
195 <div class="memproto">
196 <table class="memname">
197 <tr>
198 <td class="memname">bool <a class="el" href="classpp_1_1_u_r_l_loader.html#ada4a1757e7883912626e2ece85ec1c53">pp::URLLoader::GetDownloadProgress</a> </td>
199 <td>(</td>
200 <td class="paramtype">int64_t *&#160;</td>
201 <td class="paramname"><em>bytes_received</em>, </td>
202 </tr>
203 <tr>
204 <td class="paramkey"></td>
205 <td></td>
206 <td class="paramtype">int64_t *&#160;</td>
207 <td class="paramname"><em>total_bytes_to_be_received</em>&#160;</td>
208 </tr>
209 <tr>
210 <td></td>
211 <td>)</td>
212 <td></td><td> const</td>
213 </tr>
214 </table>
215 </div>
216 <div class="memdoc">
217 <p>This function returns the current download progress, which is meaningful after <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> has been called. </p>
218 <p>Progress only refers to the response body and does not include the headers.</p>
219 <p>This data is only available if the <code><a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a></code> passed to <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> had the <code>PP_URLREQUESTPROPERTY_REPORTDOWNLOADPROGRESS</code> property set to PP_TRUE.</p>
220 <dl class="params"><dt><b>Parameters:</b></dt><dd>
221 <table class="params">
222 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_received</td><td>The number of bytes received thus far. </td></tr>
223 <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>
224 </table>
225 </dd>
226 </dl>
227 <dl class="return"><dt><b>Returns:</b></dt><dd>true if the download progress is available, false if it is not available. </dd></dl>
228 </div>
229 </div>
230 <a class="anchor" id="a92757c9e1261280cb4f8fd65e0c8df6f"></a><!-- doxytag: member="pp::URLLoader::GetResponseInfo" ref="a92757c9e1261280cb4f8fd65e0c8df6f" args="() const " -->
231 <div class="memitem">
232 <div class="memproto">
233 <table class="memname">
234 <tr>
235 <td class="memname"><a class="el" href="classpp_1_1_u_r_l_response_info.html">URLResponseInfo</a> <a class="el" href="classpp_1_1_u_r_l_loader.html#a92757c9e1261280cb4f8fd65e0c8df6f">pp::URLLoader::GetResponseInfo</a> </td>
236 <td>(</td>
237 <td class="paramname"></td><td>)</td>
238 <td> const</td>
239 </tr>
240 </table>
241 </div>
242 <div class="memdoc">
243 <p>This is a function that returns the current <code><a class="el" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses.">URLResponseInfo</a></code> object. </p>
244 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code><a class="el" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses.">URLResponseInfo</a></code> corresponding to the <code><a class="el" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses.">URLResponseInfo</a></code> if successful, an <code>is_null</code> object if the loader is not a valid resource or if <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> has not been called. </dd></dl>
245 </div>
246 </div>
247 <a class="anchor" id="a5e3723f5c5d10394329899f75121faf1"></a><!-- doxytag: member="pp::URLLoader::GetUploadProgress" ref="a5e3723f5c5d10394329899f75121faf1" args="(int64_t *bytes_sent, int64_t *total_bytes_to_be_sent) const " -->
248 <div class="memitem">
249 <div class="memproto">
250 <table class="memname">
251 <tr>
252 <td class="memname">bool <a class="el" href="classpp_1_1_u_r_l_loader.html#a5e3723f5c5d10394329899f75121faf1">pp::URLLoader::GetUploadProgress</a> </td>
253 <td>(</td>
254 <td class="paramtype">int64_t *&#160;</td>
255 <td class="paramname"><em>bytes_sent</em>, </td>
256 </tr>
257 <tr>
258 <td class="paramkey"></td>
259 <td></td>
260 <td class="paramtype">int64_t *&#160;</td>
261 <td class="paramname"><em>total_bytes_to_be_sent</em>&#160;</td>
262 </tr>
263 <tr>
264 <td></td>
265 <td>)</td>
266 <td></td><td> const</td>
267 </tr>
268 </table>
269 </div>
270 <div class="memdoc">
271 <p>This function returns the current upload progress (which is only meaningful after <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> has been called). </p>
272 <p>Progress only refers to the request body and does not include the headers.</p>
273 <p>This data is only available if the <code><a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a></code> passed to <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> had the <code>PP_URLREQUESTPROPERTY_REPORTUPLOADPROGRESS</code> property set to <code>PP_TRUE</code>.</p>
274 <dl class="params"><dt><b>Parameters:</b></dt><dd>
275 <table class="params">
276 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_sent</td><td>The number of bytes sent thus far. </td></tr>
277 <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>
278 </table>
279 </dd>
280 </dl>
281 <dl class="return"><dt><b>Returns:</b></dt><dd>true if the upload progress is available, false if it is not available. </dd></dl>
282 </div>
283 </div>
284 <a class="anchor" id="afb72f38f30b94a2d5494225e364395b8"></a><!-- doxytag: member="pp::URLLoader::Open" ref="afb72f38f30b94a2d5494225e364395b8" args="(const URLRequestInfo &amp;request_info, const CompletionCallback &amp;cc)" -->
285 <div class="memitem">
286 <div class="memproto">
287 <table class="memname">
288 <tr>
289 <td class="memname">int32_t <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8">pp::URLLoader::Open</a> </td>
290 <td>(</td>
291 <td class="paramtype">const <a class="el" href="classpp_1_1_u_r_l_request_info.html">URLRequestInfo</a> &amp;&#160;</td>
292 <td class="paramname"><em>request_info</em>, </td>
293 </tr>
294 <tr>
295 <td class="paramkey"></td>
296 <td></td>
297 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
298 <td class="paramname"><em>cc</em>&#160;</td>
299 </tr>
300 <tr>
301 <td></td>
302 <td>)</td>
303 <td></td><td></td>
304 </tr>
305 </table>
306 </div>
307 <div class="memdoc">
308 <p>This function begins loading the <code><a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a></code>. </p>
309 <p>The operation completes when response headers are received or when an error occurs. Use <a class="el" href="classpp_1_1_u_r_l_loader.html#a92757c9e1261280cb4f8fd65e0c8df6f" title="This is a function that returns the current URLResponseInfo object.">GetResponseInfo()</a> to access the response headers.</p>
310 <dl class="params"><dt><b>Parameters:</b></dt><dd>
311 <table class="params">
312 <tr><td class="paramdir">[in]</td><td class="paramname">request_info</td><td>A <code><a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a></code> corresponding to a <a class="el" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests.">URLRequestInfo</a>. </td></tr>
313 <tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">CompletionCallback</a></code> to run on asynchronous completion of <a class="el" href="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function 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="classpp_1_1_u_r_l_loader.html#afb72f38f30b94a2d5494225e364395b8" title="This function begins loading the URLRequestInfo.">Open()</a> returns <code>PP_OK_COMPLETIONPENDING</code>.</td></tr>
314 </table>
315 </dd>
316 </dl>
317 <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code>pp_errors.h</code>. </dd></dl>
318 </div>
319 </div>
320 <a class="anchor" id="a907697c3c268a68eb3b4ca341aea4812"></a><!-- doxytag: member="pp::URLLoader::ReadResponseBody" ref="a907697c3c268a68eb3b4ca341aea4812" args="(void *buffer, int32_t bytes_to_read, const CompletionCallback &amp;cc)" -->
321 <div class="memitem">
322 <div class="memproto">
323 <table class="memname">
324 <tr>
325 <td class="memname">int32_t <a class="el" href="classpp_1_1_u_r_l_loader.html#a907697c3c268a68eb3b4ca341aea4812">pp::URLLoader::ReadResponseBody</a> </td>
326 <td>(</td>
327 <td class="paramtype">void *&#160;</td>
328 <td class="paramname"><em>buffer</em>, </td>
329 </tr>
330 <tr>
331 <td class="paramkey"></td>
332 <td></td>
333 <td class="paramtype">int32_t&#160;</td>
334 <td class="paramname"><em>bytes_to_read</em>, </td>
335 </tr>
336 <tr>
337 <td class="paramkey"></td>
338 <td></td>
339 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
340 <td class="paramname"><em>cc</em>&#160;</td>
341 </tr>
342 <tr>
343 <td></td>
344 <td>)</td>
345 <td></td><td></td>
346 </tr>
347 </table>
348 </div>
349 <div class="memdoc">
350 <p>This function is used to read the response body. </p>
351 <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>
352 <dl class="params"><dt><b>Parameters:</b></dt><dd>
353 <table class="params">
354 <tr><td class="paramdir">[in,out]</td><td class="paramname">buffer</td><td>A pointer to the buffer for the response body. </td></tr>
355 <tr><td class="paramdir">[in]</td><td class="paramname">bytes_to_read</td><td>The number of bytes to read. </td></tr>
356 <tr><td class="paramdir">[in]</td><td class="paramname">cc</td><td>A <code><a class="el" href="classpp_1_1_completion_callback.html" title="This API enables you to implement and receive callbacks when Pepper operations complete asynchronousl...">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>
357 </table>
358 </dd>
359 </dl>
360 <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing the number of bytes read or an error code from <code>pp_errors.h</code>. </dd></dl>
361 </div>
362 </div>
363 <hr />The documentation for this class was generated from the following file:<ul>
364 <li><a class="el" href="url__loader_8h.html">url_loader.h</a></li>
365 </ul>
366 </div><!-- contents -->
367 {{/partials.standard_nacl_article}}