diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 04:55:06 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-13 04:55:06 +0000 |
commit | 022eab67d0b3476ee1d35cb463990170c982429b (patch) | |
tree | b2c5517fa9e5f7a0fd7ac6938f6cac80d250d797 /base/process_util_mac.mm | |
parent | 40d9ddf8fae7521890415be1eb0d2ad8f18453a9 (diff) | |
download | chromium_src-022eab67d0b3476ee1d35cb463990170c982429b.zip chromium_src-022eab67d0b3476ee1d35cb463990170c982429b.tar.gz chromium_src-022eab67d0b3476ee1d35cb463990170c982429b.tar.bz2 |
Mac: UI tweaks for task manager.
Nib change: Reduce row height, make scrollbars smaller.
Make text in task manager table slightly smaller.
Show in decimal digit for %cpu.
Show memory in KB/MB, not always in K.
Change update frequency from 1s to 2s to match Activity Monitor's default.
(all mac-only. ui team is fine with this.)
Finally, turn taskman on.
BUG=13156
TEST=Open task manager, look at it. Should look & feel similar to Activity Monitor.
Review URL: http://codereview.chromium.org/536038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_mac.mm')
-rw-r--r-- | base/process_util_mac.mm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index a7875f3..509828b 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -248,7 +248,7 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const { (r)->tv_usec = (a)->microseconds; \ } while (0) -int ProcessMetrics::GetCPUUsage() { +double ProcessMetrics::GetCPUUsage() { mach_port_t task = TaskForPid(process_); if (task == MACH_PORT_NULL) return 0; @@ -307,8 +307,8 @@ int ProcessMetrics::GetCPUUsage() { return 0; // We add time_delta / 2 so the result is rounded. - int cpu = static_cast<int>((system_time_delta * 100 + time_delta / 2) / - (time_delta)); + double cpu = static_cast<double>( + (system_time_delta * 100.0 + time_delta / 2.0) / time_delta); last_system_time_ = task_time; last_time_ = time; |