Pepper_31_C_interfaces
Functions
Functions

Functions

PP_INLINE struct
PP_CompletionCallback 
PP_MakeCompletionCallback (PP_CompletionCallback_Func func, void *user_data)
 
PP_INLINE struct
PP_CompletionCallback 
PP_MakeOptionalCompletionCallback (PP_CompletionCallback_Func func, void *user_data)
 
PP_INLINE void PP_RunCompletionCallback (struct PP_CompletionCallback *cc, int32_t result)
 
PP_INLINE struct
PP_CompletionCallback 
PP_BlockUntilComplete (void)
 
PP_INLINE void PP_RunAndClearCompletionCallback (struct PP_CompletionCallback *cc, int32_t res)
 
PP_INLINE struct PP_Point PP_MakePoint (int32_t x, int32_t y)
 
PP_INLINE struct PP_FloatPoint PP_MakeFloatPoint (float x, float y)
 
PP_INLINE struct PP_Rect PP_MakeRectFromXYWH (int32_t x, int32_t y, int32_t w, int32_t h)
 
PP_INLINE struct PP_Size PP_MakeSize (int32_t w, int32_t h)
 
PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint (void)
 
PP_INLINE struct PP_Var PP_MakeUndefined (void)
 
PP_INLINE struct PP_Var PP_MakeNull (void)
 
PP_INLINE struct PP_Var PP_MakeBool (PP_Bool value)
 
PP_INLINE struct PP_Var PP_MakeInt32 (int32_t value)
 
PP_INLINE struct PP_Var PP_MakeDouble (double value)
 
PP_EXPORT int32_t PPP_InitializeModule (PP_Module module, PPB_GetInterface get_browser_interface)
 
PP_EXPORT void PPP_ShutdownModule (void)
 
PP_EXPORT const void * PPP_GetInterface (const char *interface_name)
 
PP_INLINE double PP_MicrosecondsDeltaToSeconds (PP_MicrosecondsDelta value)
 
PP_INLINE PP_MicrosecondsDelta PP_SecondsToMicrosecondsDelta (double value)
 

Detailed Description

Function Documentation

PP_INLINE struct PP_CompletionCallback PP_BlockUntilComplete ( void  )

PP_BlockUntilComplete() is used in place of an actual completion callback to request blocking behavior. If specified, the calling thread will block until the function completes. Blocking completion callbacks are only allowed from background threads.

Returns
A PP_CompletionCallback structure.

Definition at line 260 of file pp_completion_callback.h.

References PP_MakeCompletionCallback().

Referenced by PP_RunAndClearCompletionCallback().

PP_INLINE struct PP_Var PP_MakeBool ( PP_Bool  value)

PP_MakeBool() is used to wrap a boolean value into a PP_Var struct for passing to the browser.

Parameters
[in]valueA PP_Bool enumeration to wrap.
Returns
A PP_Var structure.

Definition at line 212 of file pp_var.h.

References PP_VarValue::as_bool, PP_FALSE, PP_VARTYPE_BOOL, and PP_Var::value.

PP_INLINE struct PP_CompletionCallback PP_MakeCompletionCallback ( PP_CompletionCallback_Func  func,
void *  user_data 
)

PP_MakeCompletionCallback() is used to create a PP_CompletionCallback.

Example, creating a Required callback:

Example, creating an Optional callback:

Parameters
[in]funcA PP_CompletionCallback_Func that will be called.
[in]user_dataA pointer to user data passed to your callback function. This is optional and is typically used to help track state when you may have multiple callbacks pending.
Returns
A PP_CompletionCallback structure.

Definition at line 190 of file pp_completion_callback.h.

References PP_CompletionCallback::flags, PP_CompletionCallback::func, PP_COMPLETIONCALLBACK_FLAG_NONE, and PP_CompletionCallback::user_data.

Referenced by PP_BlockUntilComplete(), and PP_MakeOptionalCompletionCallback().

PP_INLINE struct PP_Var PP_MakeDouble ( double  value)

PP_MakeDouble() is used to wrap a double value into a PP_Var struct for passing to the browser.

Parameters
[in]valueA double to wrap.
Returns
A PP_Var structure.

Definition at line 240 of file pp_var.h.

References PP_VarValue::as_double, PP_FALSE, PP_VARTYPE_DOUBLE, and PP_Var::value.

PP_INLINE struct PP_FloatPoint PP_MakeFloatPoint ( float  x,
float  y 
)

Definition at line 78 of file pp_point.h.

References PP_FloatPoint::x, and PP_FloatPoint::y.

PP_INLINE struct PP_Var PP_MakeInt32 ( int32_t  value)

PP_MakeInt32() is used to wrap a 32 bit integer value into a PP_Var struct for passing to the browser.

Parameters
[in]valueAn int32 to wrap.
Returns
A PP_Var structure.

Definition at line 226 of file pp_var.h.

References PP_VarValue::as_int, PP_FALSE, PP_VARTYPE_INT32, and PP_Var::value.

PP_INLINE struct PP_Var PP_MakeNull ( void  )

PP_MakeNull() is used to wrap a null value into a PP_Var struct for passing to the browser.

Returns
A PP_Var structure,

Definition at line 198 of file pp_var.h.

References PP_FALSE, and PP_VARTYPE_NULL.

PP_INLINE struct PP_CompletionCallback PP_MakeOptionalCompletionCallback ( PP_CompletionCallback_Func  func,
void *  user_data 
)

PP_MakeOptionalCompletionCallback() is used to create a PP_CompletionCallback with PP_COMPLETIONCALLBACK_FLAG_OPTIONAL set.

Parameters
[in]funcA PP_CompletionCallback_Func to be called on completion.
[in]user_dataA pointer to user data passed to be passed to the callback function. This is optional and is typically used to help track state in case of multiple pending callbacks.
Returns
A PP_CompletionCallback structure.

Definition at line 211 of file pp_completion_callback.h.

References PP_CompletionCallback::flags, PP_CompletionCallback::func, PP_COMPLETIONCALLBACK_FLAG_OPTIONAL, PP_MakeCompletionCallback(), and PP_CompletionCallback::user_data.

PP_INLINE struct PP_Point PP_MakePoint ( int32_t  x,
int32_t  y 
)

PP_MakePoint() creates a PP_Point given the x and y coordinates as int32_t values.

Parameters
[in]xAn int32_t value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate.
[in]yAn int32_t value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate.
Returns
A PP_Point structure.

Definition at line 71 of file pp_point.h.

References PP_Point::x, and PP_Point::y.

PP_INLINE struct PP_Rect PP_MakeRectFromXYWH ( int32_t  x,
int32_t  y,
int32_t  w,
int32_t  h 
)

PP_MakeRectFromXYWH() creates a PP_Rect given x and y coordinates and width and height dimensions as int32_t values.

Parameters
[in]xAn int32_t value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate.
[in]yAn int32_t value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate.
[in]wAn int32_t value representing a width.
[in]hAn int32_t value representing a height.
Returns
A PP_Rect structure.

Definition at line 63 of file pp_rect.h.

References PP_Size::height, PP_Rect::point, PP_Rect::size, PP_Size::width, PP_Point::x, and PP_Point::y.

PP_INLINE struct PP_Size PP_MakeSize ( int32_t  w,
int32_t  h 
)

PP_MakeSize() creates a PP_Size given a width and height as int32_t values.

Parameters
[in]wAn int32_t value representing a width.
[in]hAn int32_t value representing a height.
Returns
A PP_Size structure.

Definition at line 52 of file pp_size.h.

References PP_Size::height, and PP_Size::width.

PP_INLINE struct PP_TouchPoint PP_MakeTouchPoint ( void  )

PP_MakeTouchPoint() creates a PP_TouchPoint.

Returns
A PP_TouchPoint structure.

Definition at line 78 of file pp_touch_point.h.

PP_INLINE struct PP_Var PP_MakeUndefined ( void  )

PP_MakeUndefined() is used to wrap an undefined value into a PP_Var struct for passing to the browser.

Returns
A PP_Var structure.

Definition at line 187 of file pp_var.h.

References PP_FALSE, and PP_VARTYPE_UNDEFINED.

PP_INLINE double PP_MicrosecondsDeltaToSeconds ( PP_MicrosecondsDelta  value)

Converts PP_MicrosecondsDelta to seconds

Definition at line 39 of file pp_media_common_samsung.h.

PP_INLINE void PP_RunAndClearCompletionCallback ( struct PP_CompletionCallback cc,
int32_t  res 
)

PP_RunAndClearCompletionCallback() runs a callback and clears the reference to that callback.

This function is used when the null-ness of a completion callback is used as a signal for whether a completion callback has been registered. In this case, after the execution of the callback, it should be cleared. However, this introduces a conflict if the completion callback wants to schedule more work that involves the same completion callback again (for example, when reading data from an URLLoader, one would typically queue up another read callback). As a result, this function clears the pointer before the provided callback is executed.

Definition at line 277 of file pp_completion_callback.h.

References PP_BlockUntilComplete(), and PP_RunCompletionCallback().

PP_INLINE void PP_RunCompletionCallback ( struct PP_CompletionCallback cc,
int32_t  result 
)

PP_RunCompletionCallback() is used to run a callback. It invokes the callback function passing it user data specified on creation and completion |result|.

Parameters
[in]ccA pointer to a PP_CompletionCallback that will be run.
[in]resultThe result of the operation. Non-positive values correspond to the error codes from pp_errors.h (excluding PP_OK_COMPLETIONPENDING). Positive values indicate additional information such as bytes read.

Definition at line 238 of file pp_completion_callback.h.

References PP_CompletionCallback::func, and PP_CompletionCallback::user_data.

Referenced by PP_RunAndClearCompletionCallback().

PP_INLINE PP_MicrosecondsDelta PP_SecondsToMicrosecondsDelta ( double  value)

Converts seconds to PP_MicrosecondsDelta

Definition at line 44 of file pp_media_common_samsung.h.

PP_EXPORT const void* PPP_GetInterface ( const char *  interface_name)

PPP_GetInterface() is called by the browser to query the module for interfaces it supports.

Your module must implement the PPP_Instance interface or it will be unloaded. Other interfaces are optional.

This function is called from within browser code whenever an interface is needed. This means your plugin could be reentered via this function if you make a browser call and it needs an interface. Furthermore, you should not make any other browser calls from within your implementation to avoid reentering the browser.

As a result, your implementation of this should merely provide a lookup from the requested name to an interface pointer, via something like a big if/else block or a map, and not do any other work.

Parameters
[in]interface_nameA pointer to a "PPP" (plugin) interface name. Interface names are null-terminated ASCII strings.
Returns
A pointer for the interface or NULL if the interface is not supported.
PP_EXPORT int32_t PPP_InitializeModule ( PP_Module  module,
PPB_GetInterface  get_browser_interface 
)

PPP_InitializeModule() is the entry point for a module and is called by the browser when your module loads. Your code must implement this function.

Failure indicates to the browser that this module can not be used. In this case, the module will be unloaded and ShutdownModule will NOT be called.

Parameters
[in]moduleA handle to your module. Generally you should store this value since it will be required for other API calls.
[in]get_browser_interfaceA pointer to the function that you can use to query for browser interfaces. Generally you should store this value for future use.
Returns
PP_OK on success. Any other value on failure.
PP_EXPORT void PPP_ShutdownModule ( void  )

PPP_ShutdownModule() is sometimes called before the module is unloaded. It is not recommended that you implement this function.

There is no practical use of this function for third party modules. Its existence is because of some internal use cases inside Chrome.

Since your module runs in a separate process, there's no need to free allocated memory. There is also no need to free any resources since all of resources associated with an instance will be force-freed when that instance is deleted.

Note: This function will always be skipped on untrusted (Native Client) implementations. This function may be skipped on trusted implementations in certain circumstances when Chrome does "fast shutdown" of a web page.