FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
bool FB::BrowserHost::ScheduleAsyncCall ( void(*)(void *)  func,
void *  userData 
) const

Schedule asynchronous call to be executed on the main thread.

This acts exactly the same way that NPN_PluginThreadAsyncCall would in NPAPI (and in most cases calls that function on NPAPI browsers). It accepts a function of the type:

void funcName(void *userData)

The provided function will be called with the userData on the main thread. If the plugin instance is shutting down this may fail and return false

NOTE: This is a low level call; it is almost always better to use ScheduleOnMainThread

funcThe function to call.
userDataThe userData to pass to the function.
bool true if the call was scheduled, false if it could not be
See Also

Definition at line 334 of file BrowserHost.cpp.

335 {
336  if (isShutDown()) {
337  return false;
338  } else {
339  _asyncCallData* data = _asyncManager->makeCallback(func, userData);
340  bool result = _scheduleAsyncCall(&asyncCallWrapper, data);
341  if (!result) {
342  _asyncManager->remove(data);
343  }
344  return result;
345  }
346 }
bool isShutDown() const
returns true if the FB::BrowserHost::shutdown() method has been called on this object ...
Definition: BrowserHost.h:417