| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_util.h" | 5 #include "base/process_util.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <io.h> | 8 #include <io.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <psapi.h> | 10 #include <psapi.h> |
| (...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 } | 758 } |
| 759 return GetPerformanceInfo_func(pPerformanceInformation, cb); | 759 return GetPerformanceInfo_func(pPerformanceInformation, cb); |
| 760 } | 760 } |
| 761 | 761 |
| 762 size_t GetSystemCommitCharge() { | 762 size_t GetSystemCommitCharge() { |
| 763 // Get the System Page Size. | 763 // Get the System Page Size. |
| 764 SYSTEM_INFO system_info; | 764 SYSTEM_INFO system_info; |
| 765 GetSystemInfo(&system_info); | 765 GetSystemInfo(&system_info); |
| 766 | 766 |
| 767 PERFORMANCE_INFORMATION info; | 767 PERFORMANCE_INFORMATION info; |
| 768 if (! InternalGetPerformanceInfo(&info, sizeof(info))) { | 768 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
| 769 LOG(ERROR) << "Failed to fetch internal performance info."; | 769 LOG(ERROR) << "Failed to fetch internal performance info."; |
| 770 return 0; | 770 return 0; |
| 771 } | 771 } |
| 772 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 772 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
| 773 } | 773 } |
| 774 | 774 |
| 775 } // namespace base | 775 } // namespace base |
| OLD | NEW |