chromium/native_client_sdk/doc_generated/pepper_beta/c/struct_p_p_b___core__1__0.html

{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_Core Struct 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="PPB_Core" --><h2>
Data Fields</h2><table class="memberdecls">

<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#a63ea7047ef5278cc3735dbfd60bd5b81">AddRefResource</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#af3163aefc33071af39cd085a0a2d44fe">ReleaseResource</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#ga537b277d2116e42b6acfe9323d40e1a0">PP_Time</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#abae0871b4efc729f4658c37543242857">GetTime</a> )(void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#ga71cb1042cdeb38d7881b121f3b09ce94">PP_TimeTicks</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#ad6b66e732c6a592605b7b83c7bddd97d">GetTimeTicks</a> )(void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#ad23da4428f462f9f387bab423e93d1f4">CallOnMainThread</a> )(int32_t delay_in_milliseconds, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback, int32_t result)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#a2f784682b530b66ed3de692154298e17">IsMainThread</a> )(void)</td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code>PPB_Core</code> interface contains pointers to functions related to memory management, time, and threads on the browser. </p>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="a63ea7047ef5278cc3735dbfd60bd5b81"></a><!-- doxytag: member="PPB_Core::AddRefResource" ref="a63ea7047ef5278cc3735dbfd60bd5b81" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___core__1__0.html#a63ea7047ef5278cc3735dbfd60bd5b81">PPB_Core::AddRefResource</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#a63ea7047ef5278cc3735dbfd60bd5b81" title="AddRefResource() adds a reference to a resource.">AddRefResource()</a> adds a reference to a resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="ad23da4428f462f9f387bab423e93d1f4"></a><!-- doxytag: member="PPB_Core::CallOnMainThread" ref="ad23da4428f462f9f387bab423e93d1f4" args=")(int32_t delay_in_milliseconds, struct PP_CompletionCallback callback, int32_t result)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___core__1__0.html#ad23da4428f462f9f387bab423e93d1f4">PPB_Core::CallOnMainThread</a>)(int32_t delay_in_milliseconds, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback, int32_t result)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#ad23da4428f462f9f387bab423e93d1f4" title="CallOnMainThread() schedules work to be executed on the main module thread after the specified delay...">CallOnMainThread()</a> schedules work to be executed on the main module thread after the specified delay. </p>
<p>The delay may be 0 to specify a call back as soon as possible.</p>
<p>The <code>result</code> 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>
<p><b>Note:</b> CallOnMainThread, 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>
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">delay_in_milliseconds</td><td>An int32_t delay in milliseconds. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> callback function that the browser will call after the specified delay. </td></tr>
<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="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code>. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="abae0871b4efc729f4658c37543242857"></a><!-- doxytag: member="PPB_Core::GetTime" ref="abae0871b4efc729f4658c37543242857" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#ga537b277d2116e42b6acfe9323d40e1a0">PP_Time</a>(* <a class="el" href="struct_p_p_b___core__1__0.html#abae0871b4efc729f4658c37543242857">PPB_Core::GetTime</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#abae0871b4efc729f4658c37543242857" title='GetTime() returns the "wall clock time" according to the browser.'>GetTime()</a> returns the "wall clock time" according to the browser. </p>
<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>
</div>
</div>
<a class="anchor" id="ad6b66e732c6a592605b7b83c7bddd97d"></a><!-- doxytag: member="PPB_Core::GetTimeTicks" ref="ad6b66e732c6a592605b7b83c7bddd97d" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___typedefs.html#ga71cb1042cdeb38d7881b121f3b09ce94">PP_TimeTicks</a>(* <a class="el" href="struct_p_p_b___core__1__0.html#ad6b66e732c6a592605b7b83c7bddd97d">PPB_Core::GetTimeTicks</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#ad6b66e732c6a592605b7b83c7bddd97d" title='GetTimeTicks() returns the "tick time" according to the browser.'>GetTimeTicks()</a> returns the "tick time" according to the browser. </p>
<p>This clock is used by the browser when passing some event times to the module (e.g. 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="struct_p_p_b___core__1__0.html#abae0871b4efc729f4658c37543242857" title='GetTime() returns the "wall clock time" according to the browser.'>GetTime()</a>). Because of this, it will not run change if the user changes their computer clock.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_TimeTicks</code> containing the "tick time" according to the browser. </dd></dl>
</div>
</div>
<a class="anchor" id="a2f784682b530b66ed3de692154298e17"></a><!-- doxytag: member="PPB_Core::IsMainThread" ref="a2f784682b530b66ed3de692154298e17" args=")(void)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___core__1__0.html#a2f784682b530b66ed3de692154298e17">PPB_Core::IsMainThread</a>)(void)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#a2f784682b530b66ed3de692154298e17" 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>
<p>This function is useful for implementing sanity checks, and deciding if dispatching using <a class="el" href="struct_p_p_b___core__1__0.html#ad23da4428f462f9f387bab423e93d1f4" title="CallOnMainThread() schedules work to be executed on the main module thread after the specified delay...">CallOnMainThread()</a> is required.</p>
<dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the current thread is the main pepper thread, otherwise <code>PP_FALSE</code>. </dd></dl>
</div>
</div>
<a class="anchor" id="af3163aefc33071af39cd085a0a2d44fe"></a><!-- doxytag: member="PPB_Core::ReleaseResource" ref="af3163aefc33071af39cd085a0a2d44fe" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void(* <a class="el" href="struct_p_p_b___core__1__0.html#af3163aefc33071af39cd085a0a2d44fe">PPB_Core::ReleaseResource</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
</tr>
</table>
</div>
<div class="memdoc">
<p><a class="el" href="struct_p_p_b___core__1__0.html#af3163aefc33071af39cd085a0a2d44fe" title="ReleaseResource() removes a reference from a resource.">ReleaseResource()</a> removes a reference from a resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__core_8h.html">ppb_core.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}