tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit c312d825926cb411dd3260e4d8ca8d91a084249a
parent 068542d4bd076f2516c04687d39fcebf7398731d
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date:   Thu,  9 Oct 2025 19:56:11 +0000

Bug 1993570 - Make nsViewManager::GetLastUserEventTime a static. r=layout-reviewers,dshin

Differential Revision: https://phabricator.services.mozilla.com/D268204

Diffstat:
Mdom/base/nsContentSink.cpp | 6+-----
Mview/nsViewManager.cpp | 4----
Mview/nsViewManager.h | 4+---
3 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/dom/base/nsContentSink.cpp b/dom/base/nsContentSink.cpp @@ -911,11 +911,7 @@ nsresult nsContentSink::WillParseImpl(void) { uint32_t currentTime = PR_IntervalToMicroseconds(PR_IntervalNow()); if (StaticPrefs::content_sink_enable_perf_mode() == 0) { - nsViewManager* vm = presShell->GetViewManager(); - NS_ENSURE_TRUE(vm, NS_ERROR_FAILURE); - uint32_t lastEventTime; - vm->GetLastUserEventTime(lastEventTime); - + uint32_t lastEventTime = nsViewManager::GetLastUserEventTime(); bool newDynLower = mDocument->IsInBackgroundWindow() || ((currentTime - mBeginLoadTime) > StaticPrefs::content_sink_initial_perf_time() && diff --git a/view/nsViewManager.cpp b/view/nsViewManager.cpp @@ -830,10 +830,6 @@ void nsViewManager::CallWillPaintOnObservers() { } } -void nsViewManager::GetLastUserEventTime(uint32_t& aTime) { - aTime = gLastUserEventTime; -} - void nsViewManager::InvalidateHierarchy() { if (mRootView) { mRootViewManager = nullptr; diff --git a/view/nsViewManager.h b/view/nsViewManager.h @@ -259,10 +259,8 @@ class nsViewManager final { * Retrieve the time of the last user event. User events * include mouse and keyboard events. The viewmanager * saves the time of the last user event. - * - * @param aTime Last user event time in microseconds */ - void GetLastUserEventTime(uint32_t& aTime); + static uint32_t GetLastUserEventTime() { return gLastUserEventTime; } /** * Find the nearest display root view for the view aView. This is the view for