Bug 1524193 - Make audio wakelocks put background tabs into the normal priority bucket. r=gsvelto
authorMike Conley <mconley@mozilla.com>
Tue, 12 Feb 2019 15:24:29 +0000
changeset 458749 cea0ec7278c1
parent 458748 c3fde50a85f1
child 458750 bac61e8bf3a1
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgsvelto
bugs1524193
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1524193 - Make audio wakelocks put background tabs into the normal priority bucket. r=gsvelto Differential Revision: https://phabricator.services.mozilla.com/D19502
dom/ipc/ProcessPriorityManager.cpp
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -744,22 +744,23 @@ ParticularProcessPriorityManager::Notify
 }
 
 ProcessPriority ParticularProcessPriorityManager::CurrentPriority() {
   return mPriority;
 }
 
 ProcessPriority ParticularProcessPriorityManager::ComputePriority() {
   if (!mActiveTabParents.IsEmpty() ||
-      mContentParent->GetRemoteType().EqualsLiteral(EXTENSION_REMOTE_TYPE)) {
+      mContentParent->GetRemoteType().EqualsLiteral(EXTENSION_REMOTE_TYPE) ||
+      mHoldsPlayingAudioWakeLock) {
     return PROCESS_PRIORITY_FOREGROUND;
   }
 
   if (mHoldsCPUWakeLock || mHoldsHighPriorityWakeLock ||
-      mHoldsPlayingAudioWakeLock || mHoldsPlayingVideoWakeLock) {
+      mHoldsPlayingVideoWakeLock) {
     return PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE;
   }
 
   return PROCESS_PRIORITY_BACKGROUND;
 }
 
 void ParticularProcessPriorityManager::SetPriorityNow(
     ProcessPriority aPriority) {