1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>pp::Core Class Reference</h1>
4 {{- dummy div to appease doxygen -}}
6 <!-- Generated by Doxygen 1.7.6.1 -->
12 <div class="contents">
13 <!-- doxytag: class="pp::Core" -->
14 <p><a href="classpp_1_1_core-members.html">List of all members.</a></p>
16 Public Member Functions</h2><table class="memberdecls">
18 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a09c663df7fcb527b3e5e71ea07531899">AddRefResource</a> (PP_Resource resource)</td></tr>
19 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a5fd1b4530d9f01ebf3c50115238a8195">ReleaseResource</a> (PP_Resource resource)</td></tr>
20 <tr><td class="memItemLeft" align="right" valign="top">PP_Time </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a8c7991d43fc5b4fce51095ad7dccaec1">GetTime</a> ()</td></tr>
21 <tr><td class="memItemLeft" align="right" valign="top">PP_TimeTicks </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#ae80748da9fe60f2b83fbf3e18978f86f">GetTimeTicks</a> ()</td></tr>
22 <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7">CallOnMainThread</a> (int32_t delay_in_milliseconds, const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &callback, int32_t result=0)</td></tr>
23 <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a052082be868f24d1f1807afa4eb7e7e4">IsMainThread</a> ()</td></tr>
25 Friends</h2><table class="memberdecls">
26 <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a21f639900c480510650969df9c74d17d">Module</a></td></tr>
28 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
29 <div class="textblock"><p>APIs related to memory management, time, and threads. </p>
30 </div><hr /><h2>Member Function Documentation</h2>
31 <a class="anchor" id="a09c663df7fcb527b3e5e71ea07531899"></a><!-- doxytag: member="pp::Core::AddRefResource" ref="a09c663df7fcb527b3e5e71ea07531899" args="(PP_Resource resource)" -->
33 <div class="memproto">
34 <table class="memname">
36 <td class="memname">void <a class="el" href="classpp_1_1_core.html#a09c663df7fcb527b3e5e71ea07531899">pp::Core::AddRefResource</a> </td>
38 <td class="paramtype">PP_Resource </td>
39 <td class="paramname"><em>resource</em></td><td>)</td>
40 <td><code> [inline]</code></td>
45 <p><a class="el" href="classpp_1_1_core.html#a09c663df7fcb527b3e5e71ea07531899" title="AddRefResource() increments the reference count for the provided resource.">AddRefResource()</a> increments the reference count for the provided <code>resource</code>. </p>
46 <dl class="params"><dt><b>Parameters:</b></dt><dd>
47 <table class="params">
48 <tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
54 <a class="anchor" id="af20d1f92600f588bc74115fcbd17a1c7"></a><!-- doxytag: member="pp::Core::CallOnMainThread" ref="af20d1f92600f588bc74115fcbd17a1c7" args="(int32_t delay_in_milliseconds, const CompletionCallback &callback, int32_t result=0)" -->
56 <div class="memproto">
57 <table class="memname">
59 <td class="memname">void <a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7">pp::Core::CallOnMainThread</a> </td>
61 <td class="paramtype">int32_t </td>
62 <td class="paramname"><em>delay_in_milliseconds</em>, </td>
65 <td class="paramkey"></td>
67 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> & </td>
68 <td class="paramname"><em>callback</em>, </td>
71 <td class="paramkey"></td>
73 <td class="paramtype">int32_t </td>
74 <td class="paramname"><em>result</em> = <code>0</code> </td>
84 <p><a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7" title="CallOnMainThread() schedules work to be executed on the main pepper thread after the specified delay...">CallOnMainThread()</a> schedules work to be executed on the main pepper thread after the specified delay. </p>
85 <p>The delay may be 0 to specify a call back as soon as possible.</p>
86 <p>The |result| parameter will just be passed as the second argument to the callback. Many applications won't need this, but it allows a module to emulate calls of some callbacks which do use this value.</p>
87 <p><b>Note:</b> <a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7" title="CallOnMainThread() schedules work to be executed on the main pepper thread after the specified delay...">CallOnMainThread()</a>, even when used from the main thread with a delay of 0 milliseconds, will never directly invoke the callback. Even in this case, the callback will be scheduled asynchronously.</p>
88 <p><b>Note:</b> If the browser is shutting down or if the module has no instances, then the callback function may not be called.</p>
89 <dl class="params"><dt><b>Parameters:</b></dt><dd>
90 <table class="params">
91 <tr><td class="paramdir">[in]</td><td class="paramname">delay_in_milliseconds</td><td>An int32_t delay in milliseconds. </td></tr>
92 <tr><td class="paramdir">[in]</td><td class="paramname">callback</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> callback function that the browser will call after the specified delay. </td></tr>
93 <tr><td class="paramdir">[in]</td><td class="paramname">result</td><td>An int32_t that the browser will pass to the given <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>. </td></tr>
99 <a class="anchor" id="a8c7991d43fc5b4fce51095ad7dccaec1"></a><!-- doxytag: member="pp::Core::GetTime" ref="a8c7991d43fc5b4fce51095ad7dccaec1" args="()" -->
100 <div class="memitem">
101 <div class="memproto">
102 <table class="memname">
104 <td class="memname">PP_Time <a class="el" href="classpp_1_1_core.html#a8c7991d43fc5b4fce51095ad7dccaec1">pp::Core::GetTime</a> </td>
106 <td class="paramname"></td><td>)</td>
107 <td><code> [inline]</code></td>
112 <p><a class="el" href="classpp_1_1_core.html#a8c7991d43fc5b4fce51095ad7dccaec1" title='GetTime() returns the "wall clock time" according to the browser.'>GetTime()</a> returns the "wall clock time" according to the browser. </p>
113 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Time</code> containing the "wall clock time" according to the browser. </dd></dl>
116 <a class="anchor" id="ae80748da9fe60f2b83fbf3e18978f86f"></a><!-- doxytag: member="pp::Core::GetTimeTicks" ref="ae80748da9fe60f2b83fbf3e18978f86f" args="()" -->
117 <div class="memitem">
118 <div class="memproto">
119 <table class="memname">
121 <td class="memname">PP_TimeTicks <a class="el" href="classpp_1_1_core.html#ae80748da9fe60f2b83fbf3e18978f86f">pp::Core::GetTimeTicks</a> </td>
123 <td class="paramname"></td><td>)</td>
124 <td><code> [inline]</code></td>
129 <p><a class="el" href="classpp_1_1_core.html#ae80748da9fe60f2b83fbf3e18978f86f" title='GetTimeTicks() returns the "tick time" according to the browser.'>GetTimeTicks()</a> returns the "tick time" according to the browser. </p>
130 <p>This clock is used by the browser when passing some event times to the module (for example, using the <code>PP_InputEvent::time_stamp_seconds</code> field). It is not correlated to any actual wall clock time (like <a class="el" href="classpp_1_1_core.html#a8c7991d43fc5b4fce51095ad7dccaec1" title='GetTime() returns the "wall clock time" according to the browser.'>GetTime()</a>). Because of this, it will not change if the user changes their computer clock.</p>
131 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_TimeTicks</code> containing the "tick time" according to the browser. </dd></dl>
134 <a class="anchor" id="a052082be868f24d1f1807afa4eb7e7e4"></a><!-- doxytag: member="pp::Core::IsMainThread" ref="a052082be868f24d1f1807afa4eb7e7e4" args="()" -->
135 <div class="memitem">
136 <div class="memproto">
137 <table class="memname">
139 <td class="memname">bool <a class="el" href="classpp_1_1_core.html#a052082be868f24d1f1807afa4eb7e7e4">pp::Core::IsMainThread</a> </td>
141 <td class="paramname"></td><td>)</td>
147 <p><a class="el" href="classpp_1_1_core.html#a052082be868f24d1f1807afa4eb7e7e4" title="IsMainThread() returns true if the current thread is the main pepper thread.">IsMainThread()</a> returns true if the current thread is the main pepper thread. </p>
148 <p>This function is useful for implementing sanity checks, and deciding if dispatching using <a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7" title="CallOnMainThread() schedules work to be executed on the main pepper thread after the specified delay...">CallOnMainThread()</a> is required.</p>
149 <dl class="return"><dt><b>Returns:</b></dt><dd>true if the current thread is the main pepper thread, otherwise false. </dd></dl>
152 <a class="anchor" id="a5fd1b4530d9f01ebf3c50115238a8195"></a><!-- doxytag: member="pp::Core::ReleaseResource" ref="a5fd1b4530d9f01ebf3c50115238a8195" args="(PP_Resource resource)" -->
153 <div class="memitem">
154 <div class="memproto">
155 <table class="memname">
157 <td class="memname">void <a class="el" href="classpp_1_1_core.html#a5fd1b4530d9f01ebf3c50115238a8195">pp::Core::ReleaseResource</a> </td>
159 <td class="paramtype">PP_Resource </td>
160 <td class="paramname"><em>resource</em></td><td>)</td>
161 <td><code> [inline]</code></td>
166 <p><a class="el" href="classpp_1_1_core.html#a5fd1b4530d9f01ebf3c50115238a8195" title="ReleaseResource() decrements the reference count for the provided resource.">ReleaseResource()</a> decrements the reference count for the provided <code>resource</code>. </p>
167 <p>The resource will be deallocated if the reference count reaches zero.</p>
168 <dl class="params"><dt><b>Parameters:</b></dt><dd>
169 <table class="params">
170 <tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
176 <hr /><h2>Friends And Related Function Documentation</h2>
177 <a class="anchor" id="a21f639900c480510650969df9c74d17d"></a><!-- doxytag: member="pp::Core::Module" ref="a21f639900c480510650969df9c74d17d" args="" -->
178 <div class="memitem">
179 <div class="memproto">
180 <table class="memname">
182 <td class="memname">friend class <a class="el" href="classpp_1_1_module.html">Module</a><code> [friend]</code></td>
189 <hr />The documentation for this class was generated from the following file:<ul>
190 <li><a class="el" href="core_8h.html">core.h</a></li>
192 </div><!-- contents -->
194 {{/partials.standard_nacl_article}}