Bug 1820204 - Simplify some wayland vsync code. r=rmader

That code only runs in the parent process by design. And we use
infallible new so there's no need to release-assert that allocation
succeeded.

Differential Revision: https://phabricator.services.mozilla.com/D171579
This commit is contained in:
Emilio Cobos Álvarez 2023-03-03 20:47:51 +00:00
Родитель ec84fd2378
Коммит f66702754b
1 изменённых файлов: 10 добавлений и 14 удалений

Просмотреть файл

@ -3718,18 +3718,15 @@ void nsWindow::CreateCompositorVsyncDispatcher() {
nsBaseWidget::CreateCompositorVsyncDispatcher();
return;
}
if (XRE_IsParentProcess()) {
if (!mCompositorVsyncDispatcherLock) {
mCompositorVsyncDispatcherLock =
MakeUnique<Mutex>("mCompositorVsyncDispatcherLock");
}
MutexAutoLock lock(*mCompositorVsyncDispatcherLock);
if (!mCompositorVsyncDispatcher) {
LOG_VSYNC(" create CompositorVsyncDispatcher()");
mCompositorVsyncDispatcher =
new CompositorVsyncDispatcher(mWaylandVsyncDispatcher);
}
if (!mCompositorVsyncDispatcherLock) {
mCompositorVsyncDispatcherLock =
MakeUnique<Mutex>("mCompositorVsyncDispatcherLock");
}
MutexAutoLock lock(*mCompositorVsyncDispatcherLock);
if (!mCompositorVsyncDispatcher) {
LOG_VSYNC(" create CompositorVsyncDispatcher()");
mCompositorVsyncDispatcher =
new CompositorVsyncDispatcher(mWaylandVsyncDispatcher);
}
}
#endif
@ -6289,8 +6286,7 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
mWindowType == WindowType::TopLevel) {
mWaylandVsyncSource = new WaylandVsyncSource(this);
mWaylandVsyncDispatcher = new VsyncDispatcher(mWaylandVsyncSource);
LOG_VSYNC(" created WaylandVsyncSource)");
MOZ_RELEASE_ASSERT(mWaylandVsyncSource);
LOG_VSYNC(" created WaylandVsyncSource");
}
#endif