I am using CEF to bind JS with C++.I am running into the issue that OnWebKitInitialized is not being invoked at all. The native code binding is solely depending on this callback (correct me if I am wrong. But the only way the JS can call C++ is via this OnWebKitInitialized and Execute methods)
Here is the pseudo code for the initialization process.
- Code: Select all
void OnInit(){
HINSTANCE instance = wxGetInstance();
CefMainArgs main_args(instance);
CefRefPtr<CefApp> app = new MainHandler();
int exit_code = CefExecuteProcess(main_args, app, nullptr);
if (exit_code >= 0) {
// The sub-process has completed so return here.
return false;
}
// Specify CEF global settings here.
CefSettings settings;
settings.no_sandbox = true;
settings.multi_threaded_message_loop = true;
settings.ignore_certificate_errors = true;
// Initialize CEF.
CefInitialize(main_args, settings, app, nullptr);
}
Then in MainHandle class :
- Code: Select all
class MainHandle : public CefApp, public CefBrowserProcessHandler, public CefRenderProcessHandler
{
virtual OnContextCreated //full syntax
virtual void OnContextInitialized() override;
virtual void OnWebKitInitialized();
void OnRenderProcessThreadCreated(CefRefPtr<CefListValue> extra_info) ;
..other related code
}
Here OnContextInitialized and OnRenderProcessThreadCreated are being called, because the MainHandle is a subclass of browser process handler. But none of render process handler callbacks are being called.
This issue seems similar to viewtopic.php?f=6&t=719, but it does not state a solution.
Any one know how to make the OnWebKitInitialized get invoked? or if something might be wrong with the code above that might hinder the callback calling?