Is there any way to determine the function signature of an incoming JavaScript function being passed to CEF?
More specifically, I'm following the super useful JavaScript callback example provided in the CEF wiki here: https://bitbucket.org/chromiumembedded/cef/wiki/JavaScriptIntegration.md#markdown-header-executing-functions
In it, a function called myFunc() is passed to CEF via a register function:
- Code: Select all
<script language="JavaScript">
function myFunc() {
// do something in JS.
}
window.register(myFunc);
</script>
Once myFunc() triggers the following example code in the MyV8Handler::Execute() implementation:
- Code: Select all
bool MyV8Handler::Execute(const CefString& name,
CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval,
CefString& exception) {
if (name == "register") {
if (arguments.size() == 1 && arguments[0]->IsFunction()) {
callback_func_ = arguments[0];
callback_context_ = CefV8Context::GetCurrentContext();
return true;
}
}
return false;
}
I wonder if there's a way to somehow determine the signature of the function call passed in arguments[0]? If not here, is there some other way to achieve this?
If not - I'm assuming the C++ function triggering the provided callback function, has to know/hard-code the parameters it may take?
Thanks in advance,
Gazoo