| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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> |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 const_cast<wchar_t*>(cmdline.c_str()), NULL, NULL, | 269 const_cast<wchar_t*>(cmdline.c_str()), NULL, NULL, |
| 270 options.inherit_handles, flags, NULL, NULL, | 270 options.inherit_handles, flags, NULL, NULL, |
| 271 &startup_info, &process_info)) { | 271 &startup_info, &process_info)) { |
| 272 return false; | 272 return false; |
| 273 } | 273 } |
| 274 } | 274 } |
| 275 | 275 |
| 276 if (options.job_handle) { | 276 if (options.job_handle) { |
| 277 if (0 == AssignProcessToJobObject(options.job_handle, | 277 if (0 == AssignProcessToJobObject(options.job_handle, |
| 278 process_info.hProcess)) { | 278 process_info.hProcess)) { |
| 279 LOG(ERROR) << "Could not AssignProcessToObject."; | 279 DLOG(ERROR) << "Could not AssignProcessToObject."; |
| 280 KillProcess(process_info.hProcess, kProcessKilledExitCode, true); | 280 KillProcess(process_info.hProcess, kProcessKilledExitCode, true); |
| 281 return false; | 281 return false; |
| 282 } | 282 } |
| 283 | 283 |
| 284 ResumeThread(process_info.hThread); | 284 ResumeThread(process_info.hThread); |
| 285 } | 285 } |
| 286 | 286 |
| 287 // Handles must be closed or they will leak. | 287 // Handles must be closed or they will leak. |
| 288 CloseHandle(process_info.hThread); | 288 CloseHandle(process_info.hThread); |
| 289 | 289 |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 return GetPerformanceInfo_func(pPerformanceInformation, cb); | 895 return GetPerformanceInfo_func(pPerformanceInformation, cb); |
| 896 } | 896 } |
| 897 | 897 |
| 898 size_t GetSystemCommitCharge() { | 898 size_t GetSystemCommitCharge() { |
| 899 // Get the System Page Size. | 899 // Get the System Page Size. |
| 900 SYSTEM_INFO system_info; | 900 SYSTEM_INFO system_info; |
| 901 GetSystemInfo(&system_info); | 901 GetSystemInfo(&system_info); |
| 902 | 902 |
| 903 PERFORMANCE_INFORMATION info; | 903 PERFORMANCE_INFORMATION info; |
| 904 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { | 904 if (!InternalGetPerformanceInfo(&info, sizeof(info))) { |
| 905 LOG(ERROR) << "Failed to fetch internal performance info."; | 905 DLOG(ERROR) << "Failed to fetch internal performance info."; |
| 906 return 0; | 906 return 0; |
| 907 } | 907 } |
| 908 return (info.CommitTotal * system_info.dwPageSize) / 1024; | 908 return (info.CommitTotal * system_info.dwPageSize) / 1024; |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // namespace base | 911 } // namespace base |
| OLD | NEW |