Native Client

Typedefs

Typedef List

typedef void(* PP_CompletionCallback_Func )(void *user_data, int32_t result)
typedef int32_t PP_Instance
typedef int32_t PP_Module
typedef int32_t PP_Resource
typedef double PP_Time
typedef double PP_TimeTicks
typedef const void *(* PPB_GetInterface )(const char *interface_name)
typedef void(* PPB_Audio_Callback )(void *sample_buffer, uint32_t buffer_size_in_bytes, void *user_data)

Typedef Details

typedef void(* PP_CompletionCallback_Func)(void *user_data, int32_t result)

This typedef defines the signature that you implement to receive callbacks on asynchronous completion of an operation.

Parameters:
[in]user_dataA pointer to user data passed to a callback function.
[in]resultIf result is 0 (PP_OK), the operation succeeded. Negative values (other than -1 or PP_OK_COMPLETE) indicate error and are specified in pp_errors.h. Positive values for result usually indicate success and have some operation-dependent meaning (such as bytes read).

The PP_Instance value uniquely identifies one instance of a module (.nexe/PP_Module).

There will be one module instance for every <embed> tag on a page.

This identifier is an opaque handle assigned by the browser to the module. It is guaranteed never to be 0, so a module can initialize it to 0 to indicate a "NULL handle."

The PP_Module value uniquely identifies the module or .nexe.

This identifier is an opaque handle assigned by the browser to the module. It is guaranteed never to be 0, so a module can initialize it to 0 to indicate a "NULL handle."

This typdef represents an opaque handle assigned by the browser to the resource.

The handle is guaranteed never to be 0 for a valid resource, so a module can initialize it to 0 to indicate a "NULL handle." Some interfaces may return a NULL resource to indicate failure.

While a Var represents something callable to JS or from the module to the DOM, a resource has no meaning or visibility outside of the module interface.

Resources are reference counted. Use AddRefResource() and ReleaseResource() in ppb_core.h to manage the reference count of a resource. The data will be automatically destroyed when the internal reference count reaches 0.

The PP_Time type represents the "wall clock time" according to the browser and is defined as the number of seconds since the Epoch (00:00:00 UTC, January 1, 1970).

A PP_TimeTicks value represents time ticks which are measured in seconds and are used for indicating the time that certain messages were received.

In contrast to PP_Time, PP_TimeTicks does not correspond to any actual wall clock time and will not change discontinuously if the user changes their computer clock.

The units are in seconds, but are not measured relative to any particular epoch, so the most you can do is compare two values.

typedef void(* PPB_Audio_Callback)(void *sample_buffer, uint32_t buffer_size_in_bytes, void *user_data)

PPB_Audio_Callback defines the type of an audio callback function used to fill the audio buffer with data.

Please see the Create() function in the PPB_Audio interface for more details on this callback.

typedef const void*(* PPB_GetInterface)(const char *interface_name)

This function pointer type defines the signature for the PPB_GetInterface function.

A generic PPB_GetInterface pointer is passed to PPP_InitializedModule when your module is loaded. You can use this pointer to request a pointer to a specific browser interface. Browser interface names are ASCII strings and are generally defined in the header file for the interface, such as PPB_AUDIO_INTERFACE found in ppb.audio.h or PPB_GRAPHICS_2D_INTERFACE in ppb_graphics_2d.h. Click here for a complete list of interface names.

This value will be NULL if the interface is not supported on the browser.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.