Page 1 of 1

Launching CEF application as a separate Process

PostPosted: Mon Oct 03, 2016 3:30 am
by aksjain
Hi All,
I am using CEF for the first time as we have a requirement to render a login webapp from our application.
Our main application is native and windows only.
Since we can not introduce any run-time dependency on our main application, we are exploring to launch CEF application as a separate child process and will implement IPC for communication with the same.
In our implementation we hace followed following steps for launching the separate CEF process.
1. Create a new window using "CreateWindow" API and share that handle with Child process using IPC mechanism.
2. The shared parent window handle is used to create the Browser inside that by setting up.
Code: Select all
window_info.SetAsChild(pHwnd, ParentWinRect);

"pHwnd" is the handle of parent window being shared by the parent process.
3. The CEF application is "cefsimple.exe"(the sample application comes in the bundle) with some tweeks like destination URL and some more configurations being shared by the Parent process.
The problem i am facing with this implementation is that, the moment i close my parent window, CEF throws certain errors while checking the "RefCounts".
the exact line where i get the debug breaks is:
Code: Select all
#if DCHECK_IS_ON()
  // Check that all wrapper objects have been destroyed
  DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCToCpp::DebugObjCt));
  DCHECK(base::AtomicRefCountIsZero(
      &CefBeforeDownloadCallbackCToCpp::DebugObjCt));
  DCHECK(base::AtomicRefCountIsZero(&CefBinaryValueCToCpp::DebugObjCt));

this code is inside "libcef_dll_wrapper.cc".
I am not getting any pointers for the reason of this issue.
Can somebody please share some inputs?

Re: Launching CEF application as a separate Process

PostPosted: Mon Oct 03, 2016 10:54 am
by magreenblatt
How are you shutting down the "cefsimple.exe" process?