blob: 5811e35fe754dadb344530e6736dd5a3615e97d3 [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>pp::Resource Class Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="pp::Resource" --><div class="dynheader">
Inheritance diagram for pp::Resource:</div>
<div class="dyncontent">
<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>
<map name="pp_1_1_resource_inherit__map" id="pp_1_1_resource_inherit__map">
<area shape="rect" id="node2" href="classpp_1_1_audio.html" title="An audio resource." alt="" coords="216,5,299,32"></area><area shape="rect" id="node3" href="classpp_1_1_audio_buffer.html" title="pp::AudioBuffer" alt="" coords="197,56,317,83"></area><area shape="rect" id="node4" href="classpp_1_1_audio_config.html" title="A 16 bit stereo AudioConfig resource." alt="" coords="196,107,319,133"></area><area shape="rect" id="node5" href="classpp_1_1_audio_encoder.html" title="Audio encoder interface." alt="" coords="190,157,325,184"></area><area shape="rect" id="node6" href="classpp_1_1_compositor.html" title="The Compositor interface is used for setting CompositorLayer layers to the Chromium compositor for co..." alt="" coords="197,208,317,235"></area><area shape="rect" id="node7" href="classpp_1_1_compositor_layer.html" title="pp::CompositorLayer" alt="" coords="180,259,335,285"></area><area shape="rect" id="node8" href="classpp_1_1_file_i_o.html" title="The FileIO class represents a regular file." alt="" coords="218,309,297,336"></area><area shape="rect" id="node9" 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,360,300,387"></area><area shape="rect" id="node10" href="classpp_1_1_file_system.html" title="The FileSystem class identifies the file system type associated with a file." alt="" coords="200,411,315,437"></area><area shape="rect" id="node11" href="classpp_1_1_graphics2_d.html" title="pp::Graphics2D" alt="" coords="197,461,317,488"></area><area shape="rect" id="node12" href="classpp_1_1_graphics3_d.html" title="This class represents a 3D rendering context in the browser." alt="" coords="197,512,317,539"></area><area shape="rect" id="node13" href="classpp_1_1_host_resolver.html" title="The HostResolver class supports host name resolution." alt="" coords="193,563,322,589"></area><area shape="rect" id="node14" href="classpp_1_1_image_data.html" title="pp::ImageData" alt="" coords="199,613,316,640"></area><area shape="rect" id="node15" href="classpp_1_1_input_event.html" title="This class represents an input event resource." alt="" coords="200,664,315,691"></area><area shape="rect" id="node21" href="classpp_1_1_media_stream_audio_track.html" title="The MediaStreamAudioTrack class contains methods for receiving audio buffers from a MediaStream audio..." alt="" coords="157,715,357,741"></area><area shape="rect" id="node22" 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,765,357,792"></area><area shape="rect" id="node23" href="classpp_1_1_message_loop.html" title="A message loop allows PPAPI calls to be issued on a thread." alt="" coords="190,816,325,843"></area><area shape="rect" id="node24" href="classpp_1_1_net_address.html" title="The NetAddress class represents a network address." alt="" coords="197,867,318,893"></area><area shape="rect" id="node25" href="classpp_1_1_network_list.html" title="pp::NetworkList" alt="" coords="197,917,317,944"></area><area shape="rect" id="node26" href="classpp_1_1_network_monitor.html" title="pp::NetworkMonitor" alt="" coords="184,968,331,995"></area><area shape="rect" id="node27" href="classpp_1_1_t_c_p_socket.html" title="The TCPSocket class provides TCP socket operations." alt="" coords="201,1019,314,1045"></area><area shape="rect" id="node28" href="classpp_1_1_u_d_p_socket.html" title="The UDPSocket class provides UDP socket operations." alt="" coords="198,1069,317,1096"></area><area shape="rect" id="node29" href="classpp_1_1_u_r_l_loader.html" title="URLLoader provides an API for loading URLs." alt="" coords="200,1120,315,1147"></area><area shape="rect" id="node30" href="classpp_1_1_u_r_l_request_info.html" title="URLRequestInfo provides an API for creating and manipulating URL requests." alt="" coords="185,1171,330,1197"></area><area shape="rect" id="node31" href="classpp_1_1_u_r_l_response_info.html" title="URLResponseInfo provides an API for examining URL responses." alt="" coords="180,1221,335,1248"></area><area shape="rect" id="node32" href="classpp_1_1_video_decoder.html" title="Video decoder interface." alt="" coords="189,1272,325,1299"></area><area shape="rect" id="node33" href="classpp_1_1_video_encoder.html" title="Video encoder interface." alt="" coords="190,1323,325,1349"></area><area shape="rect" id="node34" href="classpp_1_1_video_frame.html" title="pp::VideoFrame" alt="" coords="196,1373,319,1400"></area><area shape="rect" id="node35" 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,1424,295,1451"></area><area shape="rect" id="node36" href="classpp_1_1_vpn_provider.html" title="The VpnProvider class enhances the chrome.vpnProvider JavaScript API by providing a high performance ..." alt="" coords="196,1475,319,1501"></area><area shape="rect" id="node37" href="classpp_1_1_web_socket.html" title="The WebSocket class providing bi-directional, full-duplex, communications over a single TCP socket..." alt="" coords="199,1525,315,1552"></area><area shape="rect" id="node16" href="classpp_1_1_i_m_e_input_event.html" title="pp::IMEInputEvent" alt="" coords="424,563,560,589"></area><area shape="rect" id="node17" href="classpp_1_1_keyboard_input_event.html" title="pp::KeyboardInputEvent" alt="" coords="405,613,579,640"></area><area shape="rect" id="node18" href="classpp_1_1_mouse_input_event.html" title="This class handles mouse events." alt="" coords="414,664,570,691"></area><area shape="rect" id="node19" href="classpp_1_1_touch_input_event.html" title="pp::TouchInputEvent" alt="" coords="417,715,567,741"></area><area shape="rect" id="node20" href="classpp_1_1_wheel_input_event.html" title="pp::WheelInputEvent" alt="" coords="416,765,568,792"></area></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<p><a href="classpp_1_1_resource-members.html">List of all members.</a></p>
<h2>
Public Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">Resource</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</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> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a081165265e2bd8217eaa2be2aeeb3aa3">~Resource</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;&#160;</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> &amp;other)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9">is_null</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_Resource&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a46a6123de0b007ad3fcb6f666534ccb4">pp_resource</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PP_Resource&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a81b9246381bdddacca3ac25f6ded2bfd">detach</a> ()</td></tr>
</table><h2>
Protected Member Functions</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a555de93fdf4793f7db1183bf71d20580">Resource</a> (PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</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>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a3eda014529127a818df8d5bb5ec2fdf0">PassRefFromConstructor</a> (PP_Resource resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#ad4016f37d3022863ca0188acb26ac9c4">Clear</a> ()</td></tr>
</table><h2>
Friends</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_resource.html#a966ff6c3e1475d52398924cc6d3cbb6d">Var</a></td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A reference counted module resource. </p>
</div><hr /><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a56679e93a58101c8dce5dc510811a094"></a><!-- doxytag: member="pp::Resource::Resource" ref="a56679e93a58101c8dce5dc510811a094" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The default constructor. </p>
</div>
</div>
<a class="anchor" id="ab0f664099ca06367180f220ea7e0b831"></a><!-- doxytag: member="pp::Resource::Resource" ref="ab0f664099ca06367180f220ea7e0b831" args="(const Resource &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor for copying a resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a081165265e2bd8217eaa2be2aeeb3aa3"></a><!-- doxytag: member="pp::Resource::~Resource" ref="a081165265e2bd8217eaa2be2aeeb3aa3" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="classpp_1_1_resource.html#a081165265e2bd8217eaa2be2aeeb3aa3">pp::Resource::~Resource</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destructor. </p>
</div>
</div>
<a class="anchor" id="a555de93fdf4793f7db1183bf71d20580"></a><!-- doxytag: member="pp::Resource::Resource" ref="a555de93fdf4793f7db1183bf71d20580" args="(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td>
<td>(</td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em></td><td>)</td>
<td><code> [explicit, protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>A constructor used when a <code>PP_Resource</code> is provided as a return value whose reference count we need to increment. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a907d3d6b7e292587c8cb9ff30d0a418d"></a><!-- doxytag: member="pp::Resource::Resource" ref="a907d3d6b7e292587c8cb9ff30d0a418d" args="(PassRef, PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_resource.html#a56679e93a58101c8dce5dc510811a094">pp::Resource::Resource</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="namespacepp.html#a339083c1beec620267bf8b3c55decaa5">PassRef</a>&#160;</td>
<td class="paramname">, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Constructor used when a <code>PP_Resource</code> already has a ref count assigned. </p>
<p>Add additional refcount is not taken. </p>
</div>
</div>
<hr /><h2>Member Function Documentation</h2>
<a class="anchor" id="ad4016f37d3022863ca0188acb26ac9c4"></a><!-- doxytag: member="pp::Resource::Clear" ref="ad4016f37d3022863ca0188acb26ac9c4" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classpp_1_1_resource.html#ad4016f37d3022863ca0188acb26ac9c4">pp::Resource::Clear</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Sets this resource to null. This releases ownership of the resource. </p>
</div>
</div>
<a class="anchor" id="a81b9246381bdddacca3ac25f6ded2bfd"></a><!-- doxytag: member="pp::Resource::detach" ref="a81b9246381bdddacca3ac25f6ded2bfd" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_Resource <a class="el" href="classpp_1_1_resource.html#a81b9246381bdddacca3ac25f6ded2bfd">pp::Resource::detach</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This function releases ownership of this resource and returns it to the caller. </p>
<p>Note that the reference count on the resource is unchanged and the caller needs to release the resource.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The detached <code>PP_Resource</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="a859068e34cdc2dc0b78754c255323aa9"></a><!-- doxytag: member="pp::Resource::is_null" ref="a859068e34cdc2dc0b78754c255323aa9" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classpp_1_1_resource.html#a859068e34cdc2dc0b78754c255323aa9">pp::Resource::is_null</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>This functions determines if this resource is invalid or uninitialized. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if this resource is invalid or uninitialized. </dd></dl>
</div>
</div>
<a class="anchor" id="aaf808a98bdaa7998d82e19514aa87423"></a><!-- doxytag: member="pp::Resource::operator=" ref="aaf808a98bdaa7998d82e19514aa87423" args="(const Resource &amp;other)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classpp_1_1_resource.html">Resource</a>&amp; pp::Resource::operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classpp_1_1_resource.html">Resource</a> &amp;&#160;</td>
<td class="paramname"><em>other</em></td><td>)</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a3eda014529127a818df8d5bb5ec2fdf0"></a><!-- doxytag: member="pp::Resource::PassRefFromConstructor" ref="a3eda014529127a818df8d5bb5ec2fdf0" args="(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classpp_1_1_resource.html#a3eda014529127a818df8d5bb5ec2fdf0">pp::Resource::PassRefFromConstructor</a> </td>
<td>(</td>
<td class="paramtype">PP_Resource&#160;</td>
<td class="paramname"><em>resource</em></td><td>)</td>
<td><code> [protected]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<p>It also assumes this object has no current resource.</p>
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a46a6123de0b007ad3fcb6f666534ccb4"></a><!-- doxytag: member="pp::Resource::pp_resource" ref="a46a6123de0b007ad3fcb6f666534ccb4" args="() const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PP_Resource <a class="el" href="classpp_1_1_resource.html#a46a6123de0b007ad3fcb6f666534ccb4">pp::Resource::pp_resource</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr /><h2>Friends And Related Function Documentation</h2>
<a class="anchor" id="a966ff6c3e1475d52398924cc6d3cbb6d"></a><!-- doxytag: member="pp::Resource::Var" ref="a966ff6c3e1475d52398924cc6d3cbb6d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">friend class <a class="el" href="classpp_1_1_var.html">Var</a><code> [friend]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<hr />The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="resource_8h.html">resource.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}