mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1604106
- Don't assert on error conditions when changing the priority of a process on Windows r=bobowen
Differential Revision: https://phabricator.services.mozilla.com/D109088
This commit is contained in:
parent
a4da022c74
commit
5d0d68e9d0
@ -20,13 +20,6 @@ void SetProcessPriority(int aPid, ProcessPriority aPriority) {
|
||||
|
||||
nsAutoHandle processHandle(
|
||||
::OpenProcess(PROCESS_SET_INFORMATION, FALSE, aPid));
|
||||
#ifdef DEBUG
|
||||
if (!processHandle) {
|
||||
printf_stderr("::OpenProcess() failed with error %#08x\n",
|
||||
::GetLastError());
|
||||
}
|
||||
#endif // DEBUG
|
||||
MOZ_ASSERT(processHandle);
|
||||
if (processHandle) {
|
||||
DWORD priority = NORMAL_PRIORITY_CLASS;
|
||||
if (aPriority == PROCESS_PRIORITY_BACKGROUND) {
|
||||
@ -34,11 +27,12 @@ void SetProcessPriority(int aPid, ProcessPriority aPriority) {
|
||||
} else if (aPriority == PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE) {
|
||||
priority = BELOW_NORMAL_PRIORITY_CLASS;
|
||||
}
|
||||
::SetPriorityClass(processHandle, priority);
|
||||
}
|
||||
|
||||
HAL_LOG("WindowsProcessPriority - priority set to %d for pid %d\n", aPriority,
|
||||
aPid);
|
||||
if (::SetPriorityClass(processHandle, priority)) {
|
||||
HAL_LOG("WindowsProcessPriority - priority set to %d for pid %d\n",
|
||||
aPriority, aPid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace hal_impl
|
||||
|
Loading…
Reference in New Issue
Block a user