mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Backed out changeset 73ed61535854 (bug 1394710) for braking Gecko Decision Task. CLOSED TREE
This commit is contained in:
parent
869e854d3c
commit
19543fe2a9
@ -38,7 +38,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'android/AndroidSensor.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
# AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
|
||||
SOURCES += [
|
||||
@ -49,7 +48,6 @@ elif CONFIG['OS_TARGET'] == 'Linux':
|
||||
'fallback/FallbackScreenConfiguration.cpp',
|
||||
'fallback/FallbackSensor.cpp',
|
||||
'fallback/FallbackVibration.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
if CONFIG['MOZ_ENABLE_DBUS']:
|
||||
UNIFIED_SOURCES += [
|
||||
@ -63,7 +61,6 @@ elif CONFIG['OS_TARGET'] == 'WINNT':
|
||||
UNIFIED_SOURCES += [
|
||||
'fallback/FallbackScreenConfiguration.cpp',
|
||||
'fallback/FallbackVibration.cpp',
|
||||
'windows/WindowsProcessPriority.cpp',
|
||||
'windows/WindowsSensor.cpp',
|
||||
]
|
||||
# WindowsBattery.cpp cannot be built in unified mode because it relies on HalImpl.h.
|
||||
@ -75,14 +72,12 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
|
||||
'cocoa/CocoaBattery.cpp',
|
||||
'fallback/FallbackScreenConfiguration.cpp',
|
||||
'fallback/FallbackVibration.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
elif CONFIG['OS_TARGET'] in ('OpenBSD', 'NetBSD', 'FreeBSD', 'DragonFly'):
|
||||
UNIFIED_SOURCES += [
|
||||
'fallback/FallbackScreenConfiguration.cpp',
|
||||
'fallback/FallbackSensor.cpp',
|
||||
'fallback/FallbackVibration.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
if CONFIG['MOZ_ENABLE_DBUS']:
|
||||
UNIFIED_SOURCES += [
|
||||
@ -98,12 +93,12 @@ else:
|
||||
'fallback/FallbackScreenConfiguration.cpp',
|
||||
'fallback/FallbackSensor.cpp',
|
||||
'fallback/FallbackVibration.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
|
||||
# Fallbacks for backends no longer implemented.
|
||||
UNIFIED_SOURCES += [
|
||||
'fallback/FallbackDiskSpaceWatcher.cpp',
|
||||
'fallback/FallbackProcessPriority.cpp',
|
||||
]
|
||||
|
||||
# Fallbacks for backends implemented on Android only.
|
||||
|
@ -1,43 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "Hal.h"
|
||||
#include "HalLog.h"
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
using namespace mozilla::hal;
|
||||
|
||||
namespace mozilla {
|
||||
namespace hal_impl {
|
||||
|
||||
bool
|
||||
SetProcessPrioritySupported()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
SetProcessPriority(int aPid, ProcessPriority aPriority)
|
||||
{
|
||||
HAL_LOG("WindowsProcessPriority - SetProcessPriority(%d, %s)\n",
|
||||
aPid, ProcessPriorityToString(aPriority));
|
||||
|
||||
HANDLE hProcess = ::OpenProcess(PROCESS_SET_INFORMATION, false, aPid);
|
||||
if (hProcess) {
|
||||
DWORD priority = NORMAL_PRIORITY_CLASS;
|
||||
if (aPriority == PROCESS_PRIORITY_BACKGROUND ||
|
||||
aPriority == PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE) {
|
||||
priority = IDLE_PRIORITY_CLASS;
|
||||
}
|
||||
::SetPriorityClass(hProcess, priority);
|
||||
::CloseHandle(hProcess);
|
||||
}
|
||||
|
||||
HAL_LOG("WindowsProcessPriority - priority set to %d for pid %d\n",
|
||||
aPriority, aPid);
|
||||
}
|
||||
|
||||
} // namespace hal_impl
|
||||
} // namespace mozilla
|
Loading…
Reference in New Issue
Block a user