OLD | NEW |
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 #include "base/process/process_metrics.h" | 5 #include "base/process/process_metrics.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <psapi.h> | 8 #include <psapi.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 GetSystemInfo(&system_info); | 277 GetSystemInfo(&system_info); |
278 | 278 |
279 PERFORMANCE_INFORMATION info; | 279 PERFORMANCE_INFORMATION info; |
280 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { | 280 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
281 DLOG(ERROR) << "Failed to fetch internal performance info."; | 281 DLOG(ERROR) << "Failed to fetch internal performance info."; |
282 return 0; | 282 return 0; |
283 } | 283 } |
284 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 284 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
285 } | 285 } |
286 | 286 |
| 287 size_t GetPageSize() { |
| 288 return PAGESIZE_KB * 1024; |
| 289 } |
| 290 |
287 } // namespace base | 291 } // namespace base |
OLD | NEW |