Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Side by Side Diff: chrome/browser/extensions/api/system_info_cpu/cpu_info_provider.h

Issue 10916197: Implement querying CPU time on Windows for systemInfo.cpu API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: updated patch Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698