author | Justin Lebar <justin.lebar@gmail.com> |
Fri, 22 Feb 2013 23:24:28 -0500 | |
changeset 122714 | 93ccd4912321292701928ab69dd3885e1f088927 |
parent 122713 | 257c5fd48f5ac91587650c02abb5aa8d0bbcd8cf |
child 122715 | 67bee77ac7e37ab95dfd47c35783ccef47af570c |
push id | 23456 |
push user | jlebar@mozilla.com |
push date | Sat, 23 Feb 2013 04:27:49 +0000 |
treeherder | mozilla-inbound@67bee77ac7e3 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | cjones |
bugs | 842679 |
milestone | 22.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
|
hal/Hal.cpp | file | annotate | diff | comparison | revisions | |
hal/HalTypes.h | file | annotate | diff | comparison | revisions | |
hal/gonk/GonkHal.cpp | file | annotate | diff | comparison | revisions |
--- a/hal/Hal.cpp +++ b/hal/Hal.cpp @@ -855,16 +855,18 @@ ProcessPriorityToString(ProcessPriority case PROCESS_PRIORITY_FOREGROUND: return "FOREGROUND"; case PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE: return "BACKGROUND_PERCEIVABLE"; case PROCESS_PRIORITY_BACKGROUND_HOMESCREEN: return "BACKGROUND_HOMESCREEN"; case PROCESS_PRIORITY_BACKGROUND: return "BACKGROUND"; + case PROCESS_PRIORITY_UNKNOWN: + return "UNKNOWN"; default: MOZ_ASSERT(false); return "???"; } } static StaticAutoPtr<ObserverList<FMRadioOperationInformation> > sFMRadioObservers;
--- a/hal/HalTypes.h +++ b/hal/HalTypes.h @@ -71,17 +71,20 @@ enum SwitchState { SWITCH_STATE_OFF, SWITCH_STATE_HEADSET, // Headphone with microphone SWITCH_STATE_HEADPHONE, // without microphone NUM_SWITCH_STATE }; typedef Observer<SwitchEvent> SwitchObserver; +// Note that we rely on the order of this enum's entries. Higher priorities +// should have larger int values. enum ProcessPriority { + PROCESS_PRIORITY_UNKNOWN = -1, PROCESS_PRIORITY_BACKGROUND, PROCESS_PRIORITY_BACKGROUND_HOMESCREEN, PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE, // Any priority greater than or equal to FOREGROUND is considered // "foreground" for the purposes of priority testing, for example // CurrentProcessIsForeground(). PROCESS_PRIORITY_FOREGROUND, PROCESS_PRIORITY_FOREGROUND_HIGH, @@ -256,17 +259,17 @@ struct ParamTraits<mozilla::hal::SwitchD public EnumSerializer<mozilla::hal::SwitchDevice, mozilla::hal::SWITCH_DEVICE_UNKNOWN, mozilla::hal::NUM_SWITCH_DEVICE> { }; template <> struct ParamTraits<mozilla::hal::ProcessPriority>: public EnumSerializer<mozilla::hal::ProcessPriority, - mozilla::hal::PROCESS_PRIORITY_BACKGROUND, + mozilla::hal::PROCESS_PRIORITY_UNKNOWN, mozilla::hal::NUM_PROCESS_PRIORITY> { }; /** * Serializer for FMRadioOperation */ template <> struct ParamTraits<mozilla::hal::FMRadioOperation>:
--- a/hal/gonk/GonkHal.cpp +++ b/hal/gonk/GonkHal.cpp @@ -1130,17 +1130,20 @@ SetProcessPriority(int aPid, ProcessPrio break; case PROCESS_PRIORITY_FOREGROUND_HIGH: priorityStr = "foregroundHigh"; break; case PROCESS_PRIORITY_MASTER: priorityStr = "master"; break; default: - MOZ_NOT_REACHED(); + // PROCESS_PRIORITY_UNKNOWN ends up in this branch, along with invalid enum + // values. + NS_ERROR("Invalid process priority!"); + return; } // Notice that you can disable oom_adj and renice by deleting the prefs // hal.processPriorityManager{foreground,background,master}{OomAdjust,Nice}. int32_t oomScoreAdj = 0; nsresult rv = Preferences::GetInt(nsPrintfCString( "hal.processPriorityManager.gonk.%sOomScoreAdjust",