| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 4 #ifndef CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 5 #define CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/system_info_provider.h" | 7 #include "chrome/browser/extensions/system_info_provider.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 private: | 38 private: |
| 39 // The amount of time that CPU spent on performing different kinds of work. | 39 // The amount of time that CPU spent on performing different kinds of work. |
| 40 // It is used to calculate the usage percent for processors. | 40 // It is used to calculate the usage percent for processors. |
| 41 struct CpuTime { | 41 struct CpuTime { |
| 42 int64 user; // user mode. | 42 int64 user; // user mode. |
| 43 int64 kernel; // kernel mode. | 43 int64 kernel; // kernel mode. |
| 44 int64 idle; // twiddling thumbs. | 44 int64 idle; // twiddling thumbs. |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 // Platform specific implementation for querying the CPU time information | 47 // Platform specific implementation for querying the CPU time information |
| 48 // for each processor. Note that the first element is the total aggregated | 48 // for each processor. |
| 49 // numbers of all logic processors. | |
| 50 bool QueryCpuTimePerProcessor(std::vector<CpuTime>* times); | 49 bool QueryCpuTimePerProcessor(std::vector<CpuTime>* times); |
| 51 }; | 50 }; |
| 52 | 51 |
| 53 } // namespace extensions | 52 } // namespace extensions |
| 54 | 53 |
| 55 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ | 54 #endif // CHROME_BROWSER_EXTENSIONS_API_SYSTEM_INFO_CPU_CPU_INFO_PROVIDER_H_ |
| 56 | 55 |
| OLD | NEW |