Page tree
Skip to end of metadata
Go to start of metadata

static void FB::BrowserHost::AsyncHtmlLog ( void *  data)

Don't call this; it is a helper function used by htmlLog.

This method is as the callback on a call to SchedulAsyncCall by htmlLog.

dataan AsyncLogRequest object in a void*

Definition at line 113 of file BrowserHost.cpp.

References FB::variant_list_of().

Referenced by htmlLog().

114 {
116  try {
117  FB::DOM::WindowPtr window = req->m_host->getDOMWindow();
119  if (window && window->getJSObject()->HasProperty("console")) {
120  FB::JSObjectPtr obj = window->getProperty<FB::JSObjectPtr>("console");
121  printf("Logging: %s\n", req->m_msg.c_str());
122  if (obj)
123  obj->Invoke("log", FB::variant_list_of(req->m_msg));
124  }
125  } catch (const std::exception &) {
126  // printf("Exception: %s\n", e.what());
127  // Fail silently; logging should not require success.
128  FBLOG_TRACE("BrowserHost", "Logging to browser console failed");
129  return;
130  }
131  delete req;
132 }
This class is used by BrowserHost for the BrowserHost::AsyncHtmlLog method.
Definition: BrowserHost.h:46
boost::shared_ptr< FB::JSObject > JSObjectPtr
Defines an alias representing a JSObject shared_ptr (you should never use a JSObject* directly) ...
Definition: APITypes.h:109
FB::detail::VariantListInserter variant_list_of(FB::variant v)
Allows convenient creation of an FB::VariantList.
Definition: variant_list.h:122
boost::shared_ptr< Window > WindowPtr
shared_ptr for a FB::DOM::Window

Here is the call graph for this function:

  • No labels