Pepper_42_C++_interfaces
|
#include <completion_callback.h>
Public Types | |
typedef internal::CallbackOutputTraits < T >::StorageType | OutputStorageType |
typedef internal::CallbackOutputTraits < T >::APIArgType | APIArgType |
Public Member Functions | |
CompletionCallbackWithOutput (OutputStorageType *output) | |
CompletionCallbackWithOutput (PP_CompletionCallback_Func func, void *user_data, OutputStorageType *output) | |
CompletionCallbackWithOutput (PP_CompletionCallback_Func func, void *user_data, int32_t flags, OutputStorageType *output) | |
APIArgType | output () const |
![]() | |
CompletionCallback () | |
CompletionCallback (PP_CompletionCallback_Func func, void *user_data) | |
CompletionCallback (PP_CompletionCallback_Func func, void *user_data, int32_t flags) | |
void | set_flags (int32_t flags) |
void | Run (int32_t result) |
void | RunAndClear (int32_t result) |
bool | IsOptional () const |
const PP_CompletionCallback & | pp_completion_callback () const |
int32_t | flags () const |
int32_t | MayForce (int32_t result) const |
Additional Inherited Members | |
![]() | |
PP_CompletionCallback | cc_ |
A CompletionCallbackWithOutput defines a completion callback that additionally stores a pointer to some output data. Some C++ wrappers take a CompletionCallbackWithOutput when the browser is returning a bit of data as part of the function call. The "output" parameter stored in the CompletionCallbackWithOutput will receive the data from the browser.
You can create this yourself, but it is most common to use with the CompletionCallbackFactory's NewCallbackWithOutput, which manages the storage for the output parameter for you and passes it as an argument to your callback function.
Note that this class doesn't actually do anything with the output data, it just stores a pointer to it. C++ wrapper objects that accept a CompletionCallbackWithOutput will retrieve this pointer and pass it to the browser as the output parameter.
Definition at line 187 of file completion_callback.h.
typedef internal::CallbackOutputTraits<T>::APIArgType pp::CompletionCallbackWithOutput< T >::APIArgType |
Definition at line 198 of file completion_callback.h.
typedef internal::CallbackOutputTraits<T>::StorageType pp::CompletionCallbackWithOutput< T >::OutputStorageType |
The type that will actually be stored in the completion callback. In the common case, this will be equal to the template parameter (for example, CompletionCallbackWithOutput<int> would obviously take an int*. However, resources are passed as PP_Resource, vars as PP_Var, and arrays as our special ArrayOutputAdapter object. The CallbackOutputTraits defines specializations for all of these cases.
Definition at line 196 of file completion_callback.h.
|
inline |
The default constructor will create a blocking CompletionCallback
that references the given output data.
[in] | output | A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback. |
Note: Blocking completion callbacks are only allowed from from background threads.
Definition at line 209 of file completion_callback.h.
|
inline |
A constructor for creating a CompletionCallback
that references the given output data.
[in] | func | The function to be called on completion. |
[in] | user_data | The user data to be passed to the callback function. This is optional and is typically used to help track state in case of multiple pending callbacks. |
[in] | output | A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback. |
Definition at line 223 of file completion_callback.h.
|
inline |
A constructor for creating a CompletionCallback
that references the given output data.
[in] | func | The function to be called on completion. |
[in] | user_data | The user data to be passed to the callback function. This is optional and is typically used to help track state in case of multiple pending callbacks. |
[in] | flags | Bit field combination of PP_CompletionCallback_Flag flags used to control how non-NULL callbacks are scheduled by asynchronous methods. |
[in] | output | A pointer to the data associated with the callback. The caller must ensure that this pointer outlives the completion callback. |
Definition at line 245 of file completion_callback.h.
|
inline |
Definition at line 253 of file completion_callback.h.
Referenced by pp::ESDataSource_Samsung::AddStream().