1 {{+bindTo:partials.standard_nacl_api}} 2 <h1>PPB_Core Struct 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 </div> 10 <!--header--> 11 <div class="contents"> 12 <!-- doxytag: class="PPB_Core" --><h2> 13 Data Fields</h2><table class="memberdecls"> 14 15 <tr><td class="memItemLeft" align="right" valign="top">void(* </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> 16 <tr><td class="memItemLeft" align="right" valign="top">void(* </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> 17 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#ga537b277d2116e42b6acfe9323d40e1a0">PP_Time</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#abae0871b4efc729f4658c37543242857">GetTime</a> )(void)</td></tr> 18 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#ga71cb1042cdeb38d7881b121f3b09ce94">PP_TimeTicks</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#ad6b66e732c6a592605b7b83c7bddd97d">GetTimeTicks</a> )(void)</td></tr> 19 <tr><td class="memItemLeft" align="right" valign="top">void(* </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> 20 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___core__1__0.html#a2f784682b530b66ed3de692154298e17">IsMainThread</a> )(void)</td></tr> 21 </table> 22 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 23 <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> 24 </div><hr /><h2>Field Documentation</h2> 25 <a class="anchor" id="a63ea7047ef5278cc3735dbfd60bd5b81"></a><!-- doxytag: member="PPB_Core::AddRefResource" ref="a63ea7047ef5278cc3735dbfd60bd5b81" args=")(PP_Resource resource)" --> 26 <div class="memitem"> 27 <div class="memproto"> 28 <table class="memname"> 29 <tr> 30 <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> 31 </tr> 32 </table> 33 </div> 34 <div class="memdoc"> 35 <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> 36 <dl class="params"><dt><b>Parameters:</b></dt><dd> 37 <table class="params"> 38 <tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr> 39 </table> 40 </dd> 41 </dl> 42 </div> 43 </div> 44 <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)" --> 45 <div class="memitem"> 46 <div class="memproto"> 47 <table class="memname"> 48 <tr> 49 <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> 50 </tr> 51 </table> 52 </div> 53 <div class="memdoc"> 54 <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> 55 <p>The delay may be 0 to specify a call back as soon as possible.</p> 56 <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> 57 <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> 58 <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> 59 <dl class="params"><dt><b>Parameters:</b></dt><dd> 60 <table class="params"> 61 <tr><td class="paramdir">[in]</td><td class="paramname">delay_in_milliseconds</td><td>An int32_t delay in milliseconds. </td></tr> 62 <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> 63 <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> 64 </table> 65 </dd> 66 </dl> 67 </div> 68 </div> 69 <a class="anchor" id="abae0871b4efc729f4658c37543242857"></a><!-- doxytag: member="PPB_Core::GetTime" ref="abae0871b4efc729f4658c37543242857" args=")(void)" --> 70 <div class="memitem"> 71 <div class="memproto"> 72 <table class="memname"> 73 <tr> 74 <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> 75 </tr> 76 </table> 77 </div> 78 <div class="memdoc"> 79 <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> 80 <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> 81 </div> 82 </div> 83 <a class="anchor" id="ad6b66e732c6a592605b7b83c7bddd97d"></a><!-- doxytag: member="PPB_Core::GetTimeTicks" ref="ad6b66e732c6a592605b7b83c7bddd97d" args=")(void)" --> 84 <div class="memitem"> 85 <div class="memproto"> 86 <table class="memname"> 87 <tr> 88 <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> 89 </tr> 90 </table> 91 </div> 92 <div class="memdoc"> 93 <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> 94 <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> 95 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_TimeTicks</code> containing the "tick time" according to the browser. </dd></dl> 96 </div> 97 </div> 98 <a class="anchor" id="a2f784682b530b66ed3de692154298e17"></a><!-- doxytag: member="PPB_Core::IsMainThread" ref="a2f784682b530b66ed3de692154298e17" args=")(void)" --> 99 <div class="memitem"> 100 <div class="memproto"> 101 <table class="memname"> 102 <tr> 103 <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> 104 </tr> 105 </table> 106 </div> 107 <div class="memdoc"> 108 <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> 109 <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> 110 <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> 111 </div> 112 </div> 113 <a class="anchor" id="af3163aefc33071af39cd085a0a2d44fe"></a><!-- doxytag: member="PPB_Core::ReleaseResource" ref="af3163aefc33071af39cd085a0a2d44fe" args=")(PP_Resource resource)" --> 114 <div class="memitem"> 115 <div class="memproto"> 116 <table class="memname"> 117 <tr> 118 <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> 119 </tr> 120 </table> 121 </div> 122 <div class="memdoc"> 123 <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> 124 <dl class="params"><dt><b>Parameters:</b></dt><dd> 125 <table class="params"> 126 <tr><td class="paramdir">[in]</td><td class="paramname">config</td><td>A <code>PP_Resource</code> corresponding to a resource. </td></tr> 127 </table> 128 </dd> 129 </dl> 130 </div> 131 </div> 132 <hr />The documentation for this struct was generated from the following file:<ul> 133 <li><a class="el" href="ppb__core_8h.html">ppb_core.h</a></li> 134 </ul> 135 </div><!-- contents --> 136 </div> 137 {{/partials.standard_nacl_api}} 138