diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 00:45:54 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 00:45:54 +0000 |
commit | f0c7a263de099efa75d9f4122c16c0c0fcaa9677 (patch) | |
tree | fbdeebec01554e1fdd5b73d678befd2b6dd9b6bb /base/process_linux.cc | |
parent | 2ccfaaa4df749f9ecb46c112c6f59e8063aadd86 (diff) | |
download | chromium_src-f0c7a263de099efa75d9f4122c16c0c0fcaa9677.zip chromium_src-f0c7a263de099efa75d9f4122c16c0c0fcaa9677.tar.gz chromium_src-f0c7a263de099efa75d9f4122c16c0c0fcaa9677.tar.bz2 |
Adjust the priority of background tabs more aggresively.
This will continue to only affect users who have their nice rlimit set so that
process priorities can be raised back to 0. That may be the default on later versions
of Ubuntu.
Review URL: http://codereview.chromium.org/523102
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_linux.cc')
-rw-r--r-- | base/process_linux.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/base/process_linux.cc b/base/process_linux.cc index 30bc1f7..21ed933 100644 --- a/base/process_linux.cc +++ b/base/process_linux.cc @@ -11,6 +11,8 @@ namespace base { +const int kPriorityAdjustment = 5; + bool Process::IsProcessBackgrounded() const { DCHECK(process_); return saved_priority_ == kUnsetProcessPriority; @@ -40,9 +42,11 @@ bool Process::SetProcessBackgrounded(bool background) { // User is not allowed to raise the priority back to where it is now. return false; } - int result = setpriority(PRIO_PROCESS, process_, current_priority + 1); + int result = + setpriority( + PRIO_PROCESS, process_, current_priority + kPriorityAdjustment); if (result == -1) { - // Failed to lower priority. + LOG(ERROR) << "Failed to lower priority, errno: " << errno; return false; } saved_priority_ = current_priority; |