Pepper_37_C_interfaces
|
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.
PP_CompletionCallback
structure. Definition at line 260 of file pp_completion_callback.h.
References PP_MakeCompletionCallback().
Referenced by PP_RunAndClearCompletionCallback().
PP_MakeBool() is used to wrap a boolean value into a PP_Var
struct for passing to the browser.
[in] | value | A PP_Bool enumeration to wrap. |
PP_Var
structure. Definition at line 223 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:
[in] | func | A PP_CompletionCallback_Func that will be called. |
[in] | user_data | A 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. |
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_MakeDouble() is used to wrap a double value into a PP_Var
struct for passing to the browser.
[in] | value | A double to wrap. |
PP_Var
structure. Definition at line 251 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_FloatRect PP_MakeFloatRectFromXYWH | ( | float | x, |
float | y, | ||
float | w, | ||
float | h | ||
) |
PP_MakeFloatRectFromXYWH() creates a PP_FloatRect
given x and y coordinates and width and height dimensions as float values.
[in] | x | An float value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate. |
[in] | y | An float value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate. |
[in] | w | An float value representing a width. |
[in] | h | An float value representing a height. |
PP_FloatRect
structure. Definition at line 100 of file pp_rect.h.
References PP_FloatSize::height, PP_FloatRect::point, PP_FloatRect::size, PP_FloatSize::width, PP_FloatPoint::x, and PP_FloatPoint::y.
PP_INLINE struct PP_FloatSize PP_MakeFloatSize | ( | float | w, |
float | h | ||
) |
PP_MakeFloatSize() creates a PP_FloatSize
given a width and height as float values.
[in] | w | An float value representing a width. |
[in] | h | An float value representing a height. |
PP_FloatSize
structure. Definition at line 78 of file pp_size.h.
References PP_FloatSize::height, and PP_FloatSize::width.
PP_MakeInt32() is used to wrap a 32 bit integer value into a PP_Var
struct for passing to the browser.
[in] | value | An int32 to wrap. |
PP_Var
structure. Definition at line 237 of file pp_var.h.
References PP_VarValue::as_int, PP_FALSE, PP_VARTYPE_INT32, and PP_Var::value.
PP_MakeNull() is used to wrap a null value into a PP_Var
struct for passing to the browser.
PP_Var
structure, Definition at line 209 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.
[in] | func | A PP_CompletionCallback_Func to be called on completion. |
[in] | user_data | A 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. |
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_MakePoint() creates a PP_Point
given the x and y coordinates as int32_t values.
[in] | x | An int32_t value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate. |
[in] | y | An int32_t value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate. |
PP_Point
structure. Definition at line 71 of file pp_point.h.
References PP_Point::x, and PP_Point::y.
PP_MakeRectFromXYWH() creates a PP_Rect
given x and y coordinates and width and height dimensions as int32_t values.
[in] | x | An int32_t value representing a horizontal coordinate of a point, starting with 0 as the left-most coordinate. |
[in] | y | An int32_t value representing a vertical coordinate of a point, starting with 0 as the top-most coordinate. |
[in] | w | An int32_t value representing a width. |
[in] | h | An int32_t value representing a height. |
PP_Rect
structure. Definition at line 77 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_MakeSize() creates a PP_Size
given a width and height as int32_t values.
[in] | w | An int32_t value representing a width. |
[in] | h | An int32_t value representing a height. |
PP_Size
structure. Definition at line 62 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
.
PP_TouchPoint
structure. Definition at line 78 of file pp_touch_point.h.
PP_MakeUndefined() is used to wrap an undefined value into a PP_Var
struct for passing to the browser.
PP_Var
structure. Definition at line 198 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 121 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|.
[in] | cc | A pointer to a PP_CompletionCallback that will be run. |
[in] | result | The 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 126 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.
[in] | interface_name | A pointer to a "PPP" (plugin) interface name. Interface names are null-terminated ASCII strings. |
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.
[in] | module | A handle to your module. Generally you should store this value since it will be required for other API calls. |
[in] | get_browser_interface | A pointer to the function that you can use to query for browser interfaces. Generally you should store this value for future use. |
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.