OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <userenv.h> | 10 #include <userenv.h> |
11 #include <psapi.h> | 11 #include <psapi.h> |
12 | 12 |
13 #include <ios> | 13 #include <ios> |
14 | 14 |
| 15 #include "base/command_line.h" |
15 #include "base/debug_util.h" | 16 #include "base/debug_util.h" |
16 #include "base/histogram.h" | 17 #include "base/histogram.h" |
17 #include "base/logging.h" | 18 #include "base/logging.h" |
18 #include "base/scoped_handle_win.h" | 19 #include "base/scoped_handle_win.h" |
19 #include "base/scoped_ptr.h" | 20 #include "base/scoped_ptr.h" |
20 | 21 |
21 // userenv.dll is required for CreateEnvironmentBlock(). | 22 // userenv.dll is required for CreateEnvironmentBlock(). |
22 #pragma comment(lib, "userenv.lib") | 23 #pragma comment(lib, "userenv.lib") |
23 | 24 |
24 namespace base { | 25 namespace base { |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 | 811 |
811 PERFORMANCE_INFORMATION info; | 812 PERFORMANCE_INFORMATION info; |
812 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { | 813 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
813 LOG(ERROR) << "Failed to fetch internal performance info."; | 814 LOG(ERROR) << "Failed to fetch internal performance info."; |
814 return 0; | 815 return 0; |
815 } | 816 } |
816 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 817 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
817 } | 818 } |
818 | 819 |
819 } // namespace base | 820 } // namespace base |
OLD | NEW |