CefDoMessageLoopWork uses a run loop object with RunUntilIdle.
This one does
- Code: Select all
void RunLoop::RunUntilIdle() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
quit_when_idle_received_ = true;
Run();
}
...
void RunLoop::Run() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
if (!BeforeRun())
return;
// If there is a RunLoopTimeout active then set the timeout.
// TODO(crbug.com/905412): Use real-time for Run() timeouts so that they
// can be applied even in tests which mock TimeTicks::Now().
CancelableOnceClosure cancelable_timeout;
const RunLoopTimeout* run_timeout = GetTimeoutForCurrentThread();
if (run_timeout) {
cancelable_timeout.Reset(
BindOnce(&OnRunLoopTimeout, Unretained(this), run_timeout->on_timeout));
origin_task_runner_->PostDelayedTask(
FROM_HERE, cancelable_timeout.callback(), run_timeout->timeout);
}
DCHECK_EQ(this, delegate_->active_run_loops_.top());
const bool application_tasks_allowed =
delegate_->active_run_loops_.size() == 1U ||
type_ == Type::kNestableTasksAllowed;
delegate_->Run(application_tasks_allowed, TimeDelta::Max());
AfterRun();
}
So basically it calls delegate_->Run, which ends up in libcef win32 in MainMessageLoopMultithreadedWin::Run().
This is a regular GetMessageLoop and does not have events. But is also not exposed upper to you can plug in your own MWMO.
I'd say your MWMO is good now, but watch the source tree. Not sure how cef can expose the loop object in a way that you might intermix it with your custom one.