summaryrefslogtreecommitdiffstats
path: root/dom/ipc/ProcessPriorityManager.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /dom/ipc/ProcessPriorityManager.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/ProcessPriorityManager.cpp')
-rw-r--r--dom/ipc/ProcessPriorityManager.cpp37
1 files changed, 5 insertions, 32 deletions
diff --git a/dom/ipc/ProcessPriorityManager.cpp b/dom/ipc/ProcessPriorityManager.cpp
index 2c54b43295..10fca879a6 100644
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -203,8 +203,6 @@ class ProcessPriorityManagerImpl final : public nsIObserver,
void BrowserPriorityChanged(CanonicalBrowsingContext* aBC, bool aPriority);
void BrowserPriorityChanged(BrowserParent* aBrowserParent, bool aPriority);
- void ResetPriority(ContentParent* aContentParent);
-
private:
static bool sPrefListenersRegistered;
static bool sInitialized;
@@ -559,12 +557,6 @@ void ProcessPriorityManagerImpl::BrowserPriorityChanged(
}
}
-void ProcessPriorityManagerImpl::ResetPriority(ContentParent* aContentParent) {
- if (RefPtr pppm = GetParticularProcessPriorityManager(aContentParent)) {
- pppm->ResetPriority();
- }
-}
-
NS_IMPL_ISUPPORTS(ParticularProcessPriorityManager, nsITimerCallback,
nsISupportsWeakReference, nsINamed);
@@ -839,11 +831,14 @@ void ParticularProcessPriorityManager::SetPriorityNow(
// thread on low-power cores. Alternately, if we are changing from the
// background to a higher priority, we change the main thread back to its
// normal state.
+ // During shutdown, we will manually set the priority to the highest
+ // possible and disallow any additional priority changes.
//
// The messages for this will be relayed using the ProcessHangMonitor such
// that the priority can be raised even if the main thread is unresponsive.
- if (PriorityUsesLowPowerMainThread(mPriority) !=
- (PriorityUsesLowPowerMainThread(oldPriority))) {
+ if (!mContentParent->IsShuttingDown() &&
+ PriorityUsesLowPowerMainThread(mPriority) !=
+ PriorityUsesLowPowerMainThread(oldPriority)) {
if (PriorityUsesLowPowerMainThread(mPriority) &&
PrefsUseLowPriorityThreads()) {
mContentParent->SetMainThreadQoSPriority(nsIThread::QOS_PRIORITY_LOW);
@@ -1042,26 +1037,4 @@ void ProcessPriorityManager::BrowserPriorityChanged(
singleton->BrowserPriorityChanged(aBrowserParent, aPriority);
}
-/* static */
-void ProcessPriorityManager::RemoteBrowserFrameShown(
- nsFrameLoader* aFrameLoader) {
- ProcessPriorityManagerImpl* singleton =
- ProcessPriorityManagerImpl::GetSingleton();
- if (!singleton) {
- return;
- }
-
- BrowserParent* bp = BrowserParent::GetFrom(aFrameLoader);
- NS_ENSURE_TRUE_VOID(bp);
-
- MOZ_ASSERT(XRE_IsParentProcess());
-
- // Ignore calls that aren't from a Browser.
- if (!aFrameLoader->OwnerIsMozBrowserFrame()) {
- return;
- }
-
- singleton->ResetPriority(bp->Manager());
-}
-
} // namespace mozilla