summaryrefslogtreecommitdiffstats
path: root/base/process_util_linux.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 17:46:15 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 17:46:15 +0000
commit655750cba246a2e3049867c3b200ca478f883230 (patch)
tree581ae4bdfb37aa3673619c021ca5796348dcb70e /base/process_util_linux.cc
parent87373acb051a898a2b6cbb56be05fc3f4d3a75bc (diff)
downloadchromium_src-655750cba246a2e3049867c3b200ca478f883230.zip
chromium_src-655750cba246a2e3049867c3b200ca478f883230.tar.gz
chromium_src-655750cba246a2e3049867c3b200ca478f883230.tar.bz2
Remove code doing a no-op due to float -> int rounding.
Make implicit float -> int/long conversions explicit. (Implicit float -> int conversions can be found by compiling with -Wconversion in gcc [versions 4.1.1 and 4.2.4, and surely many others].) Landing the patch for Jacob Mandelson, original review: http://codereview.chromium.org/201091 BUG=none TEST=app_unittests & base_unittests Review URL: http://codereview.chromium.org/200122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_linux.cc')
-rw-r--r--base/process_util_linux.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/base/process_util_linux.cc b/base/process_util_linux.cc
index 53e7d02..8342414 100644
--- a/base/process_util_linux.cc
+++ b/base/process_util_linux.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -259,7 +259,6 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
int private_kb = 0;
int pss_kb = 0;
bool have_pss = false;
- const int kPssAdjust = 0.5;
if (!file_util::ReadFileToString(stat_file, &smaps))
return false;
@@ -278,12 +277,12 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
return false;
}
if (StartsWithASCII(last_key_name, "Shared_", 1)) {
- shared_kb += StringToInt(tokenizer.token());
+ shared_kb += StringToInt(tokenizer.token());
} else if (StartsWithASCII(last_key_name, "Private_", 1)) {
- private_kb += StringToInt(tokenizer.token());
+ private_kb += StringToInt(tokenizer.token());
} else if (StartsWithASCII(last_key_name, "Pss", 1)) {
- have_pss = true;
- pss_kb += StringToInt(tokenizer.token()) + kPssAdjust;
+ have_pss = true;
+ pss_kb += StringToInt(tokenizer.token());
}
state = KEY_NAME;
break;