summaryrefslogtreecommitdiffstats
path: root/dom/ipc/ProcessPriorityManager.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/ipc/ProcessPriorityManager.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/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