OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ | 5 #ifndef CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ |
6 #define CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ | 6 #define CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <pdh.h> | 11 #include <pdh.h> |
| 12 #include <stddef.h> |
12 | 13 |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
| 16 #include "base/macros.h" |
15 #include "base/process/process_handle.h" | 17 #include "base/process/process_handle.h" |
16 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
17 | 19 |
18 namespace win { | 20 namespace win { |
19 | 21 |
20 // The traits class for PDH handles that can be closed via PdhCloseQuery() API. | 22 // The traits class for PDH handles that can be closed via PdhCloseQuery() API. |
21 struct PDHHandleTraits { | 23 struct PDHHandleTraits { |
22 typedef PDH_HQUERY Handle; | 24 typedef PDH_HQUERY Handle; |
23 static PDH_HQUERY NullHandle() { return nullptr; } | 25 static PDH_HQUERY NullHandle() { return nullptr; } |
24 static bool IsHandleValid(PDH_HQUERY handle) { return handle != nullptr; } | 26 static bool IsHandleValid(PDH_HQUERY handle) { return handle != nullptr; } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 113 |
112 // After each call to Sample this will hold the results, sorted by process id. | 114 // After each call to Sample this will hold the results, sorted by process id. |
113 std::vector<PidAndPrivateWorkingSet> records_; | 115 std::vector<PidAndPrivateWorkingSet> records_; |
114 | 116 |
115 DISALLOW_COPY_AND_ASSIGN(PrivateWorkingSetSnapshot); | 117 DISALLOW_COPY_AND_ASSIGN(PrivateWorkingSetSnapshot); |
116 }; | 118 }; |
117 | 119 |
118 #endif // defined(OS_WIN) | 120 #endif // defined(OS_WIN) |
119 | 121 |
120 #endif // CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ | 122 #endif // CHROME_BROWSER_PRIVATE_WORKING_SET_SNAPSHOT_H_ |
OLD | NEW |