Javascript binding in multiprocess mode with CEF in dll

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Re: Javascript binding in multiprocess mode with CEF in dll

Postby dougthefiddler » Fri Feb 02, 2018 6:21 pm

Yes. Here is the code from inside the RunMain function. Inside ClientApp::GetProcessType I return ClientApp::RendererProcess to ensure my RenderProcess will be created.

// Create a ClientApp of the correct type.
CefRefPtr<CefApp> app;
ClientApp::ProcessType process_type = ClientApp::GetProcessType(command_line);
if (process_type == ClientApp::BrowserProcess)
app = new ClientAppBrowser();
else if (process_type == ClientApp::RendererProcess)
app = new ClientAppRenderer();
else if (process_type == ClientApp::OtherProcess)
app = new ClientAppOther();

// Execute the secondary process, if any.
int exit_code = CefExecuteProcess(main_args, app, sandbox_info);
if (exit_code >= 0)
return exit_code;

// Create the main context object.
scoped_ptr<MainContextImpl> context(new MainContextImpl(command_line, true));

CefSettings settings;
settings.single_process = false; //trying to get Chromium to call C++ client functions using "window.myCFunc();" - only works when single_process is true
dougthefiddler
Newbie
 
Posts: 4
Joined: Fri Feb 02, 2018 2:59 pm

Re: Javascript binding in multiprocess mode with CEF in dll

Postby magreenblatt » Fri Feb 02, 2018 6:45 pm

Where are you creating the RenderDelegate instance? Is your function being called from ClientAppRenderer::CreateDelegates?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Javascript binding in multiprocess mode with CEF in dll

Postby dougthefiddler » Fri Feb 02, 2018 7:03 pm

Yes. Here is the call stack:

client::performance_test::`anonymous namespace'::RenderDelegate::RenderDelegate()
client::performance_test::CreateDelegates(delegates)
client::ClientAppRenderer::CreateDelegates(delegates)
client::ClientAppRenderer::ClientAppRenderer()
client::`anonymous namespace'::RunMain(hInstance, nCmdShow)

To me what is interesting is that:

- RenderDelegate::RenderDelegate is called for single AND multiple process.
- RenderDelegate::OnContextCreated is only called for single process only.

It's like the RenderDelegate is being created but never used for multi-process.
dougthefiddler
Newbie
 
Posts: 4
Joined: Fri Feb 02, 2018 2:59 pm

Previous

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 48 guests