Bug 994560: Compute CPU priority based on priority that is going to be set r=gsvelto

This commit is contained in:
Patrick Wang (Chih-Kai Wang) 2014-04-18 14:28:14 +08:00
parent aab8e51026
commit b91de9e100
2 changed files with 6 additions and 6 deletions

View File

@ -61,7 +61,7 @@ function runTest()
// Ensure that the preallocated process initially gets BACKGROUND priority.
// That's it.
expectProcessCreated().then(function(childID) {
return expectPriorityChange(childID, 'PREALLOC');
return expectPriorityChange(childID, 'PREALLOC', 'CPU_LOW');
}).then(function() {
// We need to set the pref asynchoronously or the preallocated process won't
// be shut down.

View File

@ -258,7 +258,7 @@ public:
ProcessPriority CurrentPriority();
ProcessPriority ComputePriority();
ProcessCPUPriority ComputeCPUPriority();
ProcessCPUPriority ComputeCPUPriority(ProcessPriority aPriority);
void ScheduleResetPriority(const char* aTimeoutPref);
void ResetPriority();
@ -956,13 +956,13 @@ ParticularProcessPriorityManager::ComputePriority()
}
ProcessCPUPriority
ParticularProcessPriorityManager::ComputeCPUPriority()
ParticularProcessPriorityManager::ComputeCPUPriority(ProcessPriority aPriority)
{
if (mPriority == PROCESS_PRIORITY_PREALLOC) {
if (aPriority == PROCESS_PRIORITY_PREALLOC) {
return PROCESS_CPU_PRIORITY_LOW;
}
if (mPriority >= PROCESS_PRIORITY_FOREGROUND_HIGH) {
if (aPriority >= PROCESS_PRIORITY_FOREGROUND_HIGH) {
return PROCESS_CPU_PRIORITY_NORMAL;
}
@ -982,7 +982,7 @@ void
ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
uint32_t aBackgroundLRU)
{
SetPriorityNow(aPriority, ComputeCPUPriority(), aBackgroundLRU);
SetPriorityNow(aPriority, ComputeCPUPriority(aPriority), aBackgroundLRU);
}
void