Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / native_client_sdk / doc_generated / pepper_beta / cpp / classpp_1_1_core.html
1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>pp::Core 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::Core" -->
14 <p><a href="classpp_1_1_core-members.html">List of all members.</a></p>
15 <h2>
16 Public Member Functions</h2><table class="memberdecls">
17
18 <tr><td class="memItemLeft" align="right" valign="top">void&#160;</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&#160;</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&#160;</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&#160;</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&#160;</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> &amp;callback, int32_t result=0)</td></tr>
23 <tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a052082be868f24d1f1807afa4eb7e7e4">IsMainThread</a> ()</td></tr>
24 </table><h2>
25 Friends</h2><table class="memberdecls">
26 <tr><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpp_1_1_core.html#a21f639900c480510650969df9c74d17d">Module</a></td></tr>
27 </table>
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)" -->
32 <div class="memitem">
33 <div class="memproto">
34 <table class="memname">
35 <tr>
36 <td class="memname">void <a class="el" href="classpp_1_1_core.html#a09c663df7fcb527b3e5e71ea07531899">pp::Core::AddRefResource</a> </td>
37 <td>(</td>
38 <td class="paramtype">PP_Resource&#160;</td>
39 <td class="paramname"><em>resource</em></td><td>)</td>
40 <td><code> [inline]</code></td>
41 </tr>
42 </table>
43 </div>
44 <div class="memdoc">
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>
49 </table>
50 </dd>
51 </dl>
52 </div>
53 </div>
54 <a class="anchor" id="af20d1f92600f588bc74115fcbd17a1c7"></a><!-- doxytag: member="pp::Core::CallOnMainThread" ref="af20d1f92600f588bc74115fcbd17a1c7" args="(int32_t delay_in_milliseconds, const CompletionCallback &amp;callback, int32_t result=0)" -->
55 <div class="memitem">
56 <div class="memproto">
57 <table class="memname">
58 <tr>
59 <td class="memname">void <a class="el" href="classpp_1_1_core.html#af20d1f92600f588bc74115fcbd17a1c7">pp::Core::CallOnMainThread</a> </td>
60 <td>(</td>
61 <td class="paramtype">int32_t&#160;</td>
62 <td class="paramname"><em>delay_in_milliseconds</em>, </td>
63 </tr>
64 <tr>
65 <td class="paramkey"></td>
66 <td></td>
67 <td class="paramtype">const <a class="el" href="classpp_1_1_completion_callback.html">CompletionCallback</a> &amp;&#160;</td>
68 <td class="paramname"><em>callback</em>, </td>
69 </tr>
70 <tr>
71 <td class="paramkey"></td>
72 <td></td>
73 <td class="paramtype">int32_t&#160;</td>
74 <td class="paramname"><em>result</em> = <code>0</code>&#160;</td>
75 </tr>
76 <tr>
77 <td></td>
78 <td>)</td>
79 <td></td><td></td>
80 </tr>
81 </table>
82 </div>
83 <div class="memdoc">
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>
94 </table>
95 </dd>
96 </dl>
97 </div>
98 </div>
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">
103 <tr>
104 <td class="memname">PP_Time <a class="el" href="classpp_1_1_core.html#a8c7991d43fc5b4fce51095ad7dccaec1">pp::Core::GetTime</a> </td>
105 <td>(</td>
106 <td class="paramname"></td><td>)</td>
107 <td><code> [inline]</code></td>
108 </tr>
109 </table>
110 </div>
111 <div class="memdoc">
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>
114 </div>
115 </div>
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">
120 <tr>
121 <td class="memname">PP_TimeTicks <a class="el" href="classpp_1_1_core.html#ae80748da9fe60f2b83fbf3e18978f86f">pp::Core::GetTimeTicks</a> </td>
122 <td>(</td>
123 <td class="paramname"></td><td>)</td>
124 <td><code> [inline]</code></td>
125 </tr>
126 </table>
127 </div>
128 <div class="memdoc">
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>
132 </div>
133 </div>
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">
138 <tr>
139 <td class="memname">bool <a class="el" href="classpp_1_1_core.html#a052082be868f24d1f1807afa4eb7e7e4">pp::Core::IsMainThread</a> </td>
140 <td>(</td>
141 <td class="paramname"></td><td>)</td>
142 <td></td>
143 </tr>
144 </table>
145 </div>
146 <div class="memdoc">
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>
150 </div>
151 </div>
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">
156 <tr>
157 <td class="memname">void <a class="el" href="classpp_1_1_core.html#a5fd1b4530d9f01ebf3c50115238a8195">pp::Core::ReleaseResource</a> </td>
158 <td>(</td>
159 <td class="paramtype">PP_Resource&#160;</td>
160 <td class="paramname"><em>resource</em></td><td>)</td>
161 <td><code> [inline]</code></td>
162 </tr>
163 </table>
164 </div>
165 <div class="memdoc">
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>
171 </table>
172 </dd>
173 </dl>
174 </div>
175 </div>
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">
181 <tr>
182 <td class="memname">friend class <a class="el" href="classpp_1_1_module.html">Module</a><code> [friend]</code></td>
183 </tr>
184 </table>
185 </div>
186 <div class="memdoc">
187 </div>
188 </div>
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>
191 </ul>
192 </div><!-- contents -->
193 </div>
194 {{/partials.standard_nacl_article}}