MyV8Handler::Execute - function is working properly.
MyMethod - never called.
How do I call a function in TID_UI thread from MyV8Handler::Execute?
- Code: Select all
void MyMethod(int arg)
{
cout << arg << endl;
}
bool MyV8Handler::Execute( const CefString& name,
CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval,
CefString& exception )
{
if (!CefCurrentlyOn(TID_UI)) {
CefPostTask(TID_UI, base::Bind(&MyMethod, 5) );
return true;
}
.
.
.
- Code: Select all
class MyV8Handler : public CefV8Handler
{
public:
MyV8Handler( );
virtual bool Execute( const CefString& name,
CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval,
CefString& exception ) override;
private:
// Provide the reference counting implementation for this class.
IMPLEMENT_REFCOUNTING(MyV8Handler);
};
Thanks.