Fix DiscardableSharedMemoryManager destruction timing

Move DiscardableSharedMemoryManager destruction to the end of UI thread
shutdown, after Mojo messages have stopped arriving. See related comments
at https://chromium-review.googlesource.com/c/chromium/src/+/5925441
This commit is contained in:
Marshall Greenblatt 2024-10-11 14:04:42 -04:00
parent 1bc1ca15d5
commit b974438cfc
1 changed files with 3 additions and 3 deletions

View File

@ -449,9 +449,6 @@ void CefMainRunner::StartShutdownOnUIThread(
content::BrowserTaskExecutor::RunAllPendingTasksOnThreadForTesting( content::BrowserTaskExecutor::RunAllPendingTasksOnThreadForTesting(
content::BrowserThread::IO); content::BrowserThread::IO);
static_cast<content::ContentMainRunnerImpl*>(main_runner_.get())
->ShutdownOnUIThread();
std::move(shutdown_on_ui_thread).Run(); std::move(shutdown_on_ui_thread).Run();
BeforeUIThreadShutdown(); BeforeUIThreadShutdown();
} }
@ -462,6 +459,9 @@ void CefMainRunner::FinishShutdownOnUIThread() {
// It is safe to call multiple times. // It is safe to call multiple times.
ChromeProcessSingleton::DeleteInstance(); ChromeProcessSingleton::DeleteInstance();
} }
static_cast<content::ContentMainRunnerImpl*>(main_runner_.get())
->ShutdownOnUIThread();
} }
void CefMainRunner::BeforeUIThreadInitialize() { void CefMainRunner::BeforeUIThreadInitialize() {