I am modifying the cefsimple application on OSX and adding callback to c++ from javascript. I am having trouble getting OnWebKitInitialized called without setting CefSettings single_process to true. I am using CEF 3.2924.1570. Has anyone else come across this problem? I can get the application to work as expected (I have the same code working on windows) but single_process doesn't appear to be recomended. I get an error message [0308/100732.335291:ERROR:proxy_service_factory.cc(130)] Cannot use V8 Proxy resolver in single process mode.
Any information about this is gratefully received
CraigZ
I am implementing the GetRenderProcesshandler in SimpleApp and overrriding the
- Code: Select all
class SimpleApp : public CefApp,
public CefRenderProcessHandler,
public CefBrowserProcessHandler {
public:
SimpleApp();
// CefApp methods:
virtual CefRefPtr<CefBrowserProcessHandler> GetBrowserProcessHandler() OVERRIDE
{
return this;
}
virtual CefRefPtr<CefRenderProcessHandler> GetRenderProcessHandler() OVERRIDE
{
return this;
}
// CefBrowserProcessHandler methods:
virtual void OnContextInitialized() OVERRIDE;
//CefRenderProcessHandler methods
virtual void OnWebKitInitialized() OVERRIDE;
and implementing OnWebKitInitialized in the App
- Code: Select all
void SimpleApp::OnWebKitInitialized()
{
std::string app_code = R"(
var mycode;
if (!mycode)
{
mycode = {};
}
(function()
{
mycode.myfunc = function(action, callBack, parameters)
{
native function myfunc();
return myfunc(action, callBack, parameters);
};
})();;
)";
CefRegisterExtension("v8/mycode", app_code.c_str(), new ClientV8ExtensionHandler(this));
}