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

Side by Side Diff: base/process/process_metrics.h

Issue 2779413002: Duplicate process handle in process_metrics_win.cc (Closed)
Patch Set: Used ScopedHandle Created 3 years, 8 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
« no previous file with comments | « no previous file | base/process/process_metrics_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // This file contains routines for gathering resource statistics for processes 5 // This file contains routines for gathering resource statistics for processes
6 // running on the system. 6 // running on the system.
7 7
8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_
9 #define BASE_PROCESS_PROCESS_METRICS_H_ 9 #define BASE_PROCESS_PROCESS_METRICS_H_
10 10
11 #include <stddef.h> 11 #include <stddef.h>
12 #include <stdint.h> 12 #include <stdint.h>
13 13
14 #include <memory> 14 #include <memory>
15 #include <string> 15 #include <string>
16 16
17 #include "base/base_export.h" 17 #include "base/base_export.h"
18 #include "base/gtest_prod_util.h" 18 #include "base/gtest_prod_util.h"
19 #include "base/macros.h" 19 #include "base/macros.h"
20 #include "base/process/process_handle.h" 20 #include "base/process/process_handle.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "base/values.h" 22 #include "base/values.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 24
25 #if defined(OS_MACOSX) 25 #if defined(OS_MACOSX)
26 #include <mach/mach.h> 26 #include <mach/mach.h>
27 #include "base/process/port_provider_mac.h" 27 #include "base/process/port_provider_mac.h"
28 #endif 28 #endif
29 29
30 #if defined(OS_WIN)
31 #include "base/win/scoped_handle.h"
32 #endif
33
30 namespace base { 34 namespace base {
31 35
32 #if defined(OS_WIN) 36 #if defined(OS_WIN)
33 struct IoCounters : public IO_COUNTERS { 37 struct IoCounters : public IO_COUNTERS {
34 }; 38 };
35 #elif defined(OS_POSIX) 39 #elif defined(OS_POSIX)
36 struct IoCounters { 40 struct IoCounters {
37 uint64_t ReadOperationCount; 41 uint64_t ReadOperationCount;
38 uint64_t WriteOperationCount; 42 uint64_t WriteOperationCount;
39 uint64_t OtherOperationCount; 43 uint64_t OtherOperationCount;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 #endif 210 #endif
207 211
208 #if defined(OS_CHROMEOS) 212 #if defined(OS_CHROMEOS)
209 bool GetWorkingSetKBytesTotmaps(WorkingSetKBytes *ws_usage) const; 213 bool GetWorkingSetKBytesTotmaps(WorkingSetKBytes *ws_usage) const;
210 #endif 214 #endif
211 215
212 #if defined(OS_MACOSX) || defined(OS_LINUX) 216 #if defined(OS_MACOSX) || defined(OS_LINUX)
213 int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups); 217 int CalculateIdleWakeupsPerSecond(uint64_t absolute_idle_wakeups);
214 #endif 218 #endif
215 219
220 #if defined(OS_WIN)
221 win::ScopedHandle process_;
222 #else
216 ProcessHandle process_; 223 ProcessHandle process_;
224 #endif
217 225
218 int processor_count_; 226 int processor_count_;
219 227
220 // Used to store the previous times and CPU usage counts so we can 228 // Used to store the previous times and CPU usage counts so we can
221 // compute the CPU usage between calls. 229 // compute the CPU usage between calls.
222 TimeTicks last_cpu_time_; 230 TimeTicks last_cpu_time_;
223 int64_t last_system_time_; 231 int64_t last_system_time_;
224 232
225 #if defined(OS_MACOSX) || defined(OS_LINUX) 233 #if defined(OS_MACOSX) || defined(OS_LINUX)
226 // Same thing for idle wakeups. 234 // Same thing for idle wakeups.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 SystemDiskInfo disk_info_; 467 SystemDiskInfo disk_info_;
460 #endif 468 #endif
461 #if defined(OS_CHROMEOS) 469 #if defined(OS_CHROMEOS)
462 SwapInfo swap_info_; 470 SwapInfo swap_info_;
463 #endif 471 #endif
464 }; 472 };
465 473
466 } // namespace base 474 } // namespace base
467 475
468 #endif // BASE_PROCESS_PROCESS_METRICS_H_ 476 #endif // BASE_PROCESS_PROCESS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | base/process/process_metrics_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698