classpp_1_1_resource.html revision 5d1f7b1de12d16ceb2c938c56701a3e8bfa558f7
1{{+bindTo:partials.standard_nacl_article}} 2<h1>pp::Resource 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::Resource" --><div class="dynheader"> 14Inheritance diagram for pp::Resource:</div> 15<div class="dyncontent"> 16<div class="center"><img src="classpp_1_1_resource__inherit__graph.png" border="0" usemap="#pp_1_1_resource_inherit__map" alt="Inheritance graph" /></div> 17<map name="pp_1_1_resource_inherit__map" id="pp_1_1_resource_inherit__map"> 18<area shape="rect" id="node3" href="classpp_1_1_audio.html" title="An audio resource." alt="" coords="216,5,299,35"></area><area shape="rect" id="node5" href="classpp_1_1_audio_config.html" title="A 16 bit stereo AudioConfig resource." alt="" coords="196,59,319,88"></area><area shape="rect" id="node7" href="classpp_1_1_audio_frame.html" title="pp::AudioFrame" alt="" coords="196,112,319,141"></area><area shape="rect" id="node9" href="classpp_1_1_file_i_o.html" title="The FileIO class represents a regular file." alt="" coords="219,165,296,195"></area><area shape="rect" id="node11" href="classpp_1_1_file_ref.html" title='The FileRef class represents a "weak pointer" to a file in a file system.' alt="" coords="215,219,300,248"></area><area shape="rect" id="node13" href="classpp_1_1_file_system.html" title="The FileSystem class identifies the file system type associated with a file." alt="" coords="200,272,315,301"></area><area shape="rect" id="node15" href="classpp_1_1_graphics2_d.html" title="pp::Graphics2D" alt="" coords="197,325,317,355"></area><area shape="rect" id="node17" href="classpp_1_1_graphics3_d.html" title="This class represents a 3D rendering context in the browser." alt="" coords="197,379,317,408"></area><area shape="rect" id="node19" href="classpp_1_1_host_resolver.html" title="The HostResolver class supports host name resolution." alt="" coords="193,432,321,461"></area><area shape="rect" id="node21" href="classpp_1_1_image_data.html" title="pp::ImageData" alt="" coords="199,485,316,515"></area><area shape="rect" id="node23" href="classpp_1_1_input_event.html" title="This class represents an input event resource." alt="" coords="200,539,315,568"></area><area shape="rect" id="node35" href="classpp_1_1_media_stream_audio_track.html" title="The MediaStreamAudioTrack class contains methods for receiving audio frames from a MediaStream audio ..." alt="" coords="157,592,357,621"></area><area shape="rect" id="node37" href="classpp_1_1_media_stream_video_track.html" title="The MediaStreamVideoTrack class contains methods for receiving video frames from a MediaStream video ..." alt="" coords="157,645,357,675"></area><area shape="rect" id="node39" href="classpp_1_1_message_loop.html" title="A message loop allows PPAPI calls to be issued on a thread." alt="" coords="191,699,324,728"></area><area shape="rect" id="node41" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address." alt="" coords="197,752,317,781"></area><area shape="rect" id="node43" href="classpp_1_1_network_list.html" title="pp::NetworkList" alt="" coords="197,805,317,835"></area><area shape="rect" id="node45" href="classpp_1_1_network_monitor.html" title="pp::NetworkMonitor" alt="" coords="184,859,331,888"></area><area shape="rect" id="node47" href="classpp_1_1_t_c_p_socket.html" title="The TCPSocket class provides TCP socket operations." alt="" coords="201,912,313,941"></area><area shape="rect" id="node49" href="classpp_1_1_u_d_p_socket.html" title="The UDPSocket class provides UDP socket operations." alt="" coords="199,965,316,995"></area><area shape="rect" id="node51" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs." alt="" coords="200,1019,315,1048"></area><area shape="rect" id="node53" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests." alt="" coords="185,1072,329,1101"></area><area shape="rect" id="node55" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses." alt="" coords="180,1125,335,1155"></area><area shape="rect" id="node57" href="classpp_1_1_video_frame.html" title="pp::VideoFrame" alt="" coords="196,1179,319,1208"></area><area shape="rect" id="node59" href="classpp_1_1_view.html" title="This class represents the state of the view for an instance and contains functions for retrieving the..." alt="" coords="220,1232,295,1261"></area><area shape="rect" id="node61" href="classpp_1_1_web_socket.html" title="The WebSocket class providing bi-directional, full-duplex, communications over a single TCP socket..." alt="" coords="200,1285,315,1315"></area><area shape="rect" id="node25" href="classpp_1_1_i_m_e_input_event.html" title="pp::IMEInputEvent" alt="" coords="424,432,560,461"></area><area shape="rect" id="node27" href="classpp_1_1_keyboard_input_event.html" title="pp::KeyboardInputEvent" alt="" coords="405,485,579,515"></area><area shape="rect" id="node29" href="classpp_1_1_mouse_input_event.html" title="This class handles mouse events." alt="" coords="415,539,569,568"></area><area shape="rect" id="node31" href="classpp_1_1_touch_input_event.html" title="pp::TouchInputEvent" alt="" coords="417,592,567,621"></area><area shape="rect" id="node33" href="classpp_1_1_wheel_input_event.html" title="pp::WheelInputEvent" alt="" coords="416,645,568,675"></area></map> 19<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> 20<p><a href="classpp_1_1_resource-members.html">List of all members.</a></p> 21<h2> 22Public Member Functions</h2><table class="memberdecls"> 23 24<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">Resource</a> ()</td></tr> 25<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#ab0f664099ca06367180f220ea7e0b831">Resource</a> (const <a class="el" href="classpp_1_1_resource.html">Resource</a> &other)</td></tr> 26<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a081165265e2bd8217eaa2be2aeeb3aa3">~Resource</a> ()</td></tr> 27<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_resource.html">Resource</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#aaf808a98bdaa7998d82e19514aa87423">operator=</a> (const <a class="el" href="classpp_1_1_resource.html">Resource</a> &other)</td></tr> 28<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9">is_null</a> () const </td></tr> 29<tr><td class="memItemLeft" align="right" valign="top">PP_Resource </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a46a6123de0b007ad3fcb6f666534ccb4">pp_resource</a> () const </td></tr> 30<tr><td class="memItemLeft" align="right" valign="top">PP_Resource </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a81b9246381bdddacca3ac25f6ded2bfd">detach</a> ()</td></tr> 31</table><h2> 32Protected Member Functions</h2><table class="memberdecls"> 33<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a555de93fdf4793f7db1183bf71d20580">Resource</a> (PP_Resource resource)</td></tr> 34<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a907d3d6b7e292587c8cb9ff30d0a418d">Resource</a> (<a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>, PP_Resource resource)</td></tr> 35<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a3eda014529127a818df8d5bb5ec2fdf0">PassRefFromConstructor</a> (PP_Resource resource)</td></tr> 36<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#ad4016f37d3022863ca0188acb26ac9c4">Clear</a> ()</td></tr> 37</table><h2> 38Friends</h2><table class="memberdecls"> 39<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#aef268205011788a4a9f05ed201384ace">VarResource_Dev</a></td></tr> 40</table> 41<hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 42<div class="textblock"><p>A reference counted module resource. </p> 43</div><hr /><h2>Constructor & Destructor Documentation</h2> 44<a class="anchor" id="a56679e93a58101c8dce5dc510811a094"></a><!-- doxytag: member="pp::Resource::Resource" ref="a56679e93a58101c8dce5dc510811a094" args="()" --> 45<div class="memitem"> 46<div class="memproto"> 47<table class="memname"> 48<tr> 49<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td> 50<td>(</td> 51<td class="paramname"></td><td>)</td> 52<td></td> 53</tr> 54</table> 55</div> 56<div class="memdoc"> 57<p>The default constructor. </p> 58</div> 59</div> 60<a class="anchor" id="ab0f664099ca06367180f220ea7e0b831"></a><!-- doxytag: member="pp::Resource::Resource" ref="ab0f664099ca06367180f220ea7e0b831" args="(const Resource &other)" --> 61<div class="memitem"> 62<div class="memproto"> 63<table class="memname"> 64<tr> 65<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td> 66<td>(</td> 67<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> & </td> 68<td class="paramname"><em>other</em></td><td>)</td> 69<td></td> 70</tr> 71</table> 72</div> 73<div class="memdoc"> 74<p>A constructor for copying a resource. </p> 75<dl class="params"><dt><b>Parameters:</b></dt><dd> 76<table class="params"> 77<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code>. </td></tr> 78</table> 79</dd> 80</dl> 81</div> 82</div> 83<a class="anchor" id="a081165265e2bd8217eaa2be2aeeb3aa3"></a><!-- doxytag: member="pp::Resource::~Resource" ref="a081165265e2bd8217eaa2be2aeeb3aa3" args="()" --> 84<div class="memitem"> 85<div class="memproto"> 86<table class="memname"> 87<tr> 88<td class="memname">virtual <a class="el" href="classpp_1_1_resource.html#a081165265e2bd8217eaa2be2aeeb3aa3">pp::Resource::~Resource</a> </td> 89<td>(</td> 90<td class="paramname"></td><td>)</td> 91<td><code> [virtual]</code></td> 92</tr> 93</table> 94</div> 95<div class="memdoc"> 96<p>Destructor. </p> 97</div> 98</div> 99<a class="anchor" id="a555de93fdf4793f7db1183bf71d20580"></a><!-- doxytag: member="pp::Resource::Resource" ref="a555de93fdf4793f7db1183bf71d20580" args="(PP_Resource resource)" --> 100<div class="memitem"> 101<div class="memproto"> 102<table class="memname"> 103<tr> 104<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td> 105<td>(</td> 106<td class="paramtype">PP_Resource </td> 107<td class="paramname"><em>resource</em></td><td>)</td> 108<td><code> [explicit, protected]</code></td> 109</tr> 110</table> 111</div> 112<div class="memdoc"> 113<p>A constructor used when a <code>PP_Resource</code> is provided as a return value whose reference count we need to increment. </p> 114<dl class="params"><dt><b>Parameters:</b></dt><dd> 115<table class="params"> 116<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr> 117</table> 118</dd> 119</dl> 120</div> 121</div> 122<a class="anchor" id="a907d3d6b7e292587c8cb9ff30d0a418d"></a><!-- doxytag: member="pp::Resource::Resource" ref="a907d3d6b7e292587c8cb9ff30d0a418d" args="(PassRef, PP_Resource resource)" --> 123<div class="memitem"> 124<div class="memproto"> 125<table class="memname"> 126<tr> 127<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td> 128<td>(</td> 129<td class="paramtype"><a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a> </td> 130<td class="paramname">, </td> 131</tr> 132<tr> 133<td class="paramkey"></td> 134<td></td> 135<td class="paramtype">PP_Resource </td> 136<td class="paramname"><em>resource</em> </td> 137</tr> 138<tr> 139<td></td> 140<td>)</td> 141<td></td><td><code> [protected]</code></td> 142</tr> 143</table> 144</div> 145<div class="memdoc"> 146<p>Constructor used when a <code>PP_Resource</code> already has a ref count assigned. </p> 147<p>Add additional refcount is not taken. </p> 148</div> 149</div> 150<hr /><h2>Member Function Documentation</h2> 151<a class="anchor" id="ad4016f37d3022863ca0188acb26ac9c4"></a><!-- doxytag: member="pp::Resource::Clear" ref="ad4016f37d3022863ca0188acb26ac9c4" args="()" --> 152<div class="memitem"> 153<div class="memproto"> 154<table class="memname"> 155<tr> 156<td class="memname">void <a class="el" href="classpp_1_1_resource.html#ad4016f37d3022863ca0188acb26ac9c4">pp::Resource::Clear</a> </td> 157<td>(</td> 158<td class="paramname"></td><td>)</td> 159<td><code> [protected]</code></td> 160</tr> 161</table> 162</div> 163<div class="memdoc"> 164<p>Sets this resource to null. This releases ownership of the resource. </p> 165</div> 166</div> 167<a class="anchor" id="a81b9246381bdddacca3ac25f6ded2bfd"></a><!-- doxytag: member="pp::Resource::detach" ref="a81b9246381bdddacca3ac25f6ded2bfd" args="()" --> 168<div class="memitem"> 169<div class="memproto"> 170<table class="memname"> 171<tr> 172<td class="memname">PP_Resource <a class="el" href="classpp_1_1_resource.html#a81b9246381bdddacca3ac25f6ded2bfd">pp::Resource::detach</a> </td> 173<td>(</td> 174<td class="paramname"></td><td>)</td> 175<td></td> 176</tr> 177</table> 178</div> 179<div class="memdoc"> 180<p>This function releases ownership of this resource and returns it to the caller. </p> 181<p>Note that the reference count on the resource is unchanged and the caller needs to release the resource.</p> 182<dl class="return"><dt><b>Returns:</b></dt><dd>The detached <code>PP_Resource</code>. </dd></dl> 183</div> 184</div> 185<a class="anchor" id="a859068e34cdc2dc0b78754c255323aa9"></a><!-- doxytag: member="pp::Resource::is_null" ref="a859068e34cdc2dc0b78754c255323aa9" args="() const " --> 186<div class="memitem"> 187<div class="memproto"> 188<table class="memname"> 189<tr> 190<td class="memname">bool <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9">pp::Resource::is_null</a> </td> 191<td>(</td> 192<td class="paramname"></td><td>)</td> 193<td> const<code> [inline]</code></td> 194</tr> 195</table> 196</div> 197<div class="memdoc"> 198<p>This functions determines if this resource is invalid or uninitialized. </p> 199<dl class="return"><dt><b>Returns:</b></dt><dd>true if this resource is invalid or uninitialized. </dd></dl> 200</div> 201</div> 202<a class="anchor" id="aaf808a98bdaa7998d82e19514aa87423"></a><!-- doxytag: member="pp::Resource::operator=" ref="aaf808a98bdaa7998d82e19514aa87423" args="(const Resource &other)" --> 203<div class="memitem"> 204<div class="memproto"> 205<table class="memname"> 206<tr> 207<td class="memname"><a class="el" href="classpp_1_1_resource.html">Resource</a>& pp::Resource::operator= </td> 208<td>(</td> 209<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> & </td> 210<td class="paramname"><em>other</em></td><td>)</td> 211<td></td> 212</tr> 213</table> 214</div> 215<div class="memdoc"> 216<p>This function assigns one <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code> to another <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code>. </p> 217<dl class="params"><dt><b>Parameters:</b></dt><dd> 218<table class="params"> 219<tr><td class="paramdir">[in]</td><td class="paramname">other</td><td>A <a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a>.</td></tr> 220</table> 221</dd> 222</dl> 223<dl class="return"><dt><b>Returns:</b></dt><dd>A <a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a> containing the assigned <a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a>. </dd></dl> 224</div> 225</div> 226<a class="anchor" id="a3eda014529127a818df8d5bb5ec2fdf0"></a><!-- doxytag: member="pp::Resource::PassRefFromConstructor" ref="a3eda014529127a818df8d5bb5ec2fdf0" args="(PP_Resource resource)" --> 227<div class="memitem"> 228<div class="memproto"> 229<table class="memname"> 230<tr> 231<td class="memname">void <a class="el" href="classpp_1_1_resource.html#a3eda014529127a818df8d5bb5ec2fdf0">pp::Resource::PassRefFromConstructor</a> </td> 232<td>(</td> 233<td class="paramtype">PP_Resource </td> 234<td class="paramname"><em>resource</em></td><td>)</td> 235<td><code> [protected]</code></td> 236</tr> 237</table> 238</div> 239<div class="memdoc"> 240<p>PassRefFromConstructor is called by derived class' constructors to initialize this <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code> with a <code>PP_Resource</code> that has already had its reference count incremented by <code><a class="el" href="classpp_1_1_core.html#a09c663df7fcb527b3e5e71ea07531899" title="AddRefResource() increments the reference count for the provided resource.">Core::AddRefResource</a></code>. </p> 241<p>It also assumes this object has no current resource.</p> 242<p>The intended usage of this function that the derived class constructor will call the default <code><a class="el" href="classpp_1_1_resource.html" title="A reference counted module resource.">Resource</a></code> constructor, then make a call to create a resource. It then wants to assign the new resource (which, since it was returned by the browser, already had its reference count increased).</p> 243<dl class="params"><dt><b>Parameters:</b></dt><dd> 244<table class="params"> 245<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr> 246</table> 247</dd> 248</dl> 249</div> 250</div> 251<a class="anchor" id="a46a6123de0b007ad3fcb6f666534ccb4"></a><!-- doxytag: member="pp::Resource::pp_resource" ref="a46a6123de0b007ad3fcb6f666534ccb4" args="() const " --> 252<div class="memitem"> 253<div class="memproto"> 254<table class="memname"> 255<tr> 256<td class="memname">PP_Resource <a class="el" href="classpp_1_1_resource.html#a46a6123de0b007ad3fcb6f666534ccb4">pp::Resource::pp_resource</a> </td> 257<td>(</td> 258<td class="paramname"></td><td>)</td> 259<td> const<code> [inline]</code></td> 260</tr> 261</table> 262</div> 263<div class="memdoc"> 264</div> 265</div> 266<hr /><h2>Friends And Related Function Documentation</h2> 267<a class="anchor" id="aef268205011788a4a9f05ed201384ace"></a><!-- doxytag: member="pp::Resource::VarResource_Dev" ref="aef268205011788a4a9f05ed201384ace" args="" --> 268<div class="memitem"> 269<div class="memproto"> 270<table class="memname"> 271<tr> 272<td class="memname">friend class <a class="el" href="classpp_1_1_resource.html#aef268205011788a4a9f05ed201384ace">VarResource_Dev</a><code> [friend]</code></td> 273</tr> 274</table> 275</div> 276<div class="memdoc"> 277</div> 278</div> 279<hr />The documentation for this class was generated from the following file:<ul> 280<li><a class="el" href="resource_8h.html">resource.h</a></li> 281</ul> 282</div><!-- contents --> 283</div> 284{{/partials.standard_nacl_article}} 285