Split UI thread shutdown into before and after stages (see #3609)

Existing UI thread shutdown tasks need to be executed before the UI
thread RunLoop is terminated. Those tasks have now been moved to
CefMainRunner::StartShutdownOnUIThread and FinishShutdownOnUIThread is
now called after the RunLoop is terminated.

This fixes a shutdown crash in ChromeProcessSingleton::DeleteInstance.
DeleteInstance needs to be called on the UI thread near the end of the
shutdown process (after ChromeProcessSingleton::Cleanup is called via
PostMainMessageLoopRun).
This commit is contained in:
Marshall Greenblatt
2023-12-11 15:36:56 -05:00
parent 80c65f25a3
commit 262a93b2f7
7 changed files with 77 additions and 60 deletions

View File

@ -26,6 +26,7 @@ class CefMainRunnerDelegate {
virtual bool HandleMainMessageLoopQuit() { return false; }
virtual void BeforeUIThreadInitialize() {}
virtual void AfterUIThreadInitialize() {}
virtual void BeforeUIThreadShutdown() {}
virtual void AfterUIThreadShutdown() {}
virtual void BeforeMainThreadShutdown() {}
virtual void AfterMainThreadShutdown() {}