Skip to content

Commit

Permalink
Bug 1712357 - Don't adjust the priority of ContentParents that are go…
Browse files Browse the repository at this point in the history
…ing away. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D116496
  • Loading branch information
amccreight committed Jun 1, 2021
1 parent 2c30dfd commit b800c44
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dom/ipc/ProcessPriorityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ ProcessPriorityManagerImpl::Observe(nsISupports* aSubject, const char* aTopic,
already_AddRefed<ParticularProcessPriorityManager>
ProcessPriorityManagerImpl::GetParticularProcessPriorityManager(
ContentParent* aContentParent) {
// If this content parent is already being shut down, there's no
// need to adjust its priority.
if (aContentParent->IsDead()) {
return nullptr;
}

const uint64_t cpId = aContentParent->ChildID();
return mParticularManagers.WithEntryHandle(cpId, [&](auto&& entry) {
if (!entry) {
Expand Down Expand Up @@ -498,6 +504,7 @@ ParticularProcessPriorityManager::ParticularProcessPriorityManager(
mHoldsPlayingAudioWakeLock(false),
mHoldsPlayingVideoWakeLock(false) {
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_RELEASE_ASSERT(!aContentParent->IsDead());
LOGP("Creating ParticularProcessPriorityManager.");
}

Expand Down

0 comments on commit b800c44

Please sign in to comment.