I need to implement a sync JS function, so I need to "wait" on the main thread of renderer process, until ipc message received from browser process.
I can not use real waiting methods like "std::condition_variable" or Windws WaitForSingleObject or CefWaitableEvent, because it will block the main thread and renderer process can not receive ipc messages.
I think I need to start a nested message loop to make the waiting.
Noticed that CefDoMessageLoopWork is limited to be run on browser process.
If it is called on renderer process, there is a check that ensure CefContext has been initialized. CefContext is initialied by CefInitialize, which will not run for renderer process.
So, is there any way to execute a raw base::RunLoop::RunUntilIdle ?