chrome: Move ThreadProfiler initialization to the UI thread (fixes #3465)

ThreadProfiler::CreateAndStartOnMainThread and SetMainThreadTaskRunnerImpl
should be called on the same thread.
This commit is contained in:
Marshall Greenblatt
2023-03-14 15:12:03 -04:00
parent 178a44bd18
commit 0a2c7a1070
4 changed files with 8 additions and 5 deletions

View File

@@ -394,6 +394,7 @@ bool CefMainRunner::ContentMainRun(bool* initialized,
if (!CreateUIThread(base::BindOnce(
[](CefMainRunner* runner, base::WaitableEvent* event) {
runner->main_delegate_->BeforeUIThreadInitialize();
content::ContentMainRun(runner->main_runner_.get());
event->Signal();
},
@@ -408,6 +409,7 @@ bool CefMainRunner::ContentMainRun(bool* initialized,
uithread_startup_event.Wait();
} else {
*initialized = true;
main_delegate_->BeforeUIThreadInitialize();
content::ContentMainRun(main_runner_.get());
}