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