| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/process/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 res->Set("meminfo", memory_info_.ToValue().release()); | 35 res->Set("meminfo", memory_info_.ToValue().release()); |
| 36 res->Set("diskinfo", disk_info_.ToValue().release()); | 36 res->Set("diskinfo", disk_info_.ToValue().release()); |
| 37 #endif | 37 #endif |
| 38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
| 39 res->Set("swapinfo", swap_info_.ToValue().release()); | 39 res->Set("swapinfo", swap_info_.ToValue().release()); |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 return res.PassAs<Value>(); | 42 return res.PassAs<Value>(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 double ProcessMetrics::GetPlatformIndependentCPUUsage() { |
| 46 #if defined(OS_WIN) |
| 47 return GetCPUUsage() * processor_count_; |
| 48 #else |
| 49 return GetCPUUsage(); |
| 50 #endif |
| 51 } |
| 52 |
| 45 } // namespace base | 53 } // namespace base |
| OLD | NEW |