示例#1
0
int FB::BrowserHost::delayedInvoke(const int delayms, const FB::JSObjectPtr& func,
                                    const FB::VariantList& args, const std::string& fname)
{
    assertMainThread();
    FB::JSObjectPtr delegate = getDelayedInvokeDelegate();
    assert(delegate);
    if (fname.empty())
        return delegate->Invoke("", FB::variant_list_of(delayms)(func)(args)).convert_cast<int>();
    else
        return delegate->Invoke("", FB::variant_list_of(delayms)(func)(args)(fname)).convert_cast<int>();
}
示例#2
0
int FB::BrowserHost::delayedInvoke(const int delayms, const FB::JSObjectPtr& func,
                                    const FB::VariantList& args, const std::string& fname)
{
    assertMainThread();
    FB::JSObjectPtr delegate = getDelayedInvokeDelegate();
    if (!delegate)
        return -1;  // this is wrong (the return is meant to be the result of setTimeout)
    if (fname.empty())
        return delegate->Invoke("", FB::variant_list_of(delayms)(func)(args)).convert_cast<int>();
    else
        return delegate->Invoke("", FB::variant_list_of(delayms)(func)(args)(fname)).convert_cast<int>();
}