зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1727972 - Use the user activity flag in the CCGCScheduler r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D123889
This commit is contained in:
Родитель
4fd2dca330
Коммит
7bb60676ad
|
@ -142,6 +142,7 @@ class CCGCScheduler {
|
|||
|
||||
void UserIsInactive();
|
||||
void UserIsActive();
|
||||
bool IsUserActive() const { return mUserIsActive; }
|
||||
|
||||
void KillShrinkingGCTimer();
|
||||
void KillFullGCTimer();
|
||||
|
|
|
@ -1612,15 +1612,7 @@ void nsJSContext::MaybeRunNextCollectorSlice(nsIDocShell* aDocShell,
|
|||
return;
|
||||
}
|
||||
|
||||
// GetLastUserEventTime returns microseconds.
|
||||
uint32_t lastEventTime = 0;
|
||||
vm->GetLastUserEventTime(lastEventTime);
|
||||
uint32_t currentTime = PR_IntervalToMicroseconds(PR_IntervalNow());
|
||||
// Only try to trigger collectors more often if user hasn't interacted with
|
||||
// the page for awhile.
|
||||
if ((currentTime - lastEventTime) >
|
||||
(StaticPrefs::dom_events_user_interaction_interval() *
|
||||
PR_USEC_PER_MSEC)) {
|
||||
if (!sScheduler.IsUserActive()) {
|
||||
Maybe<TimeStamp> next = nsRefreshDriver::GetNextTickHint();
|
||||
// Try to not delay the next RefreshDriver tick, so give a reasonable
|
||||
// deadline for collectors.
|
||||
|
|
Загрузка…
Ссылка в новой задаче