mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 20:30:41 +00:00
Bug 1366356 - Decrease the process priority of content processes that are not running a foreground tab - part 2 - enabled if the platform specific code is ready, r=smaug
This commit is contained in:
parent
61f1dc1bf7
commit
44e8750e68
@ -332,7 +332,7 @@ ProcessPriorityManagerImpl::PrefChangedCallback(const char* aPref,
|
||||
/* static */ bool
|
||||
ProcessPriorityManagerImpl::PrefsEnabled()
|
||||
{
|
||||
return sPrefsEnabled && !sRemoteTabsDisabled;
|
||||
return sPrefsEnabled && hal::SetProcessPrioritySupported() && !sRemoteTabsDisabled;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
|
@ -850,6 +850,12 @@ NotifySwitchChange(const SwitchEvent& aEvent)
|
||||
observer.Broadcast(aEvent);
|
||||
}
|
||||
|
||||
bool
|
||||
SetProcessPrioritySupported()
|
||||
{
|
||||
RETURN_PROXY_IF_SANDBOXED(SetProcessPrioritySupported(), false);
|
||||
}
|
||||
|
||||
void
|
||||
SetProcessPriority(int aPid, ProcessPriority aPriority)
|
||||
{
|
||||
|
@ -430,6 +430,12 @@ hal::SwitchState GetCurrentSwitchState(hal::SwitchDevice aDevice);
|
||||
void NotifySwitchStateFromInputDevice(hal::SwitchDevice aDevice,
|
||||
hal::SwitchState aState);
|
||||
|
||||
/**
|
||||
* Return true if the current platform supports the setting of process
|
||||
* priority.
|
||||
*/
|
||||
bool SetProcessPrioritySupported();
|
||||
|
||||
/**
|
||||
* Set the priority of the given process.
|
||||
*
|
||||
|
@ -10,6 +10,12 @@ using namespace mozilla::hal;
|
||||
namespace mozilla {
|
||||
namespace hal_impl {
|
||||
|
||||
bool
|
||||
SetProcessPrioritySupported()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
SetProcessPriority(int aPid, ProcessPriority aPriority)
|
||||
{
|
||||
|
@ -354,6 +354,13 @@ SetProcessPriority(int aPid, ProcessPriority aPriority)
|
||||
NS_RUNTIMEABORT("Only the main process may set processes' priorities.");
|
||||
}
|
||||
|
||||
bool
|
||||
SetProcessPrioritySupported()
|
||||
{
|
||||
NS_RUNTIMEABORT("Only the main process may call SetProcessPrioritySupported().");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
SetCurrentThreadPriority(ThreadPriority aThreadPriority)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user