| 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 #include <winternl.h> | 9 #include <winternl.h> |
| 10 | 10 |
| 11 #include <algorithm> |
| 12 |
| 11 #include "base/logging.h" | 13 #include "base/logging.h" |
| 12 #include "base/sys_info.h" | 14 #include "base/sys_info.h" |
| 13 | 15 |
| 14 namespace base { | 16 namespace base { |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 // System pagesize. This value remains constant on x86/64 architectures. | 19 // System pagesize. This value remains constant on x86/64 architectures. |
| 18 const int PAGESIZE_KB = 4; | 20 const int PAGESIZE_KB = 4; |
| 19 | 21 |
| 20 typedef NTSTATUS(WINAPI* NTQUERYSYSTEMINFORMATION)( | 22 typedef NTSTATUS(WINAPI* NTQUERYSYSTEMINFORMATION)( |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 318 |
| 317 meminfo->total = mem_status.ullTotalPhys / 1024; | 319 meminfo->total = mem_status.ullTotalPhys / 1024; |
| 318 meminfo->free = mem_status.ullAvailPhys / 1024; | 320 meminfo->free = mem_status.ullAvailPhys / 1024; |
| 319 meminfo->swap_total = mem_status.ullTotalPageFile / 1024; | 321 meminfo->swap_total = mem_status.ullTotalPageFile / 1024; |
| 320 meminfo->swap_free = mem_status.ullAvailPageFile / 1024; | 322 meminfo->swap_free = mem_status.ullAvailPageFile / 1024; |
| 321 | 323 |
| 322 return true; | 324 return true; |
| 323 } | 325 } |
| 324 | 326 |
| 325 } // namespace base | 327 } // namespace base |
| OLD | NEW |