Bug 1698582 - Simplify the CoalescedMouseMoveFlusher::GetRefreshDriver method.r=sefeng

This patch simplifies the null-checks in CoalescedMouseMoveFlusher::GetRefreshDriver

Differential Revision: https://phabricator.services.mozilla.com/D108492
This commit is contained in:
amurali 2021-03-16 13:23:31 +00:00
parent 59df028a0f
commit e5bc013bd0

View File

@ -106,10 +106,8 @@ CoalescedMouseMoveFlusher::CoalescedMouseMoveFlusher(
CoalescedMouseMoveFlusher::~CoalescedMouseMoveFlusher() { RemoveObserver(); }
nsRefreshDriver* CoalescedMouseMoveFlusher::GetRefreshDriver() {
PresShell* presShell = mBrowserChild->GetTopLevelPresShell();
if (!presShell || !presShell->GetPresContext() ||
!presShell->GetPresContext()->RefreshDriver()) {
return nullptr;
if (PresShell* presShell = mBrowserChild->GetTopLevelPresShell()) {
return presShell->GetRefreshDriver();
}
return presShell->GetPresContext()->RefreshDriver();
return nullptr;
}