Bug 1875528 - Part 3: Remove unnecessary VsyncChild strong reference in BrowserChild, r=smaug

This reference created a cycle after the strong Manager() reference added in an earlier part.

With the reference removed, the VsyncChild will be kept alive via the IPC link
instead, and will be torn down when the IPDL actor is destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D198626
This commit is contained in:
Nika Layzell committed 2024-01-24 20:54:40 +00:00
1 parent 1c3c2e0a51
commit 1863636c52
2 files changed
+11 -8

No files matched your search

+11 -6
View File
@@ -2150,18 +2150,23 @@ bool BrowserChild::DeallocPDocAccessibleChild(
#endif
RefPtr<VsyncMainChild> BrowserChild::GetVsyncChild() {
// Initializing mVsyncChild here turns on per-BrowserChild Vsync for a
// Initializing VsyncMainChild here turns on per-BrowserChild Vsync for a
// given platform. Note: this only makes sense if nsWindow returns a
// window-specific VsyncSource.
#if defined(MOZ_WAYLAND)
if (IsWaylandEnabled() && !mVsyncChild) {
mVsyncChild = MakeRefPtr<VsyncMainChild>();
if (!SendPVsyncConstructor(mVsyncChild)) {
mVsyncChild = nullptr;
if (IsWaylandEnabled()) {
if (auto* actor = static_cast<VsyncMainChild*>(
LoneManagedOrNullAsserts(ManagedPVsyncChild()))) {
return actor;
}
auto actor = MakeRefPtr<VsyncMainChild>();
if (!SendPVsyncConstructor(actor)) {
return nullptr;
}
return actor;
}
#endif
return mVsyncChild;
return nullptr;
}
mozilla::ipc::IPCResult BrowserChild::RecvLoadRemoteScript(
-2
View File
@@ -748,8 +748,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
Maybe<bool> mLayersConnectRequested;
EffectsInfo mEffectsInfo;
RefPtr<VsyncMainChild> mVsyncChild;
RefPtr<APZEventState> mAPZEventState;
// Position of client area relative to the outer window