OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/task_manager/task_manager_os_resources_win.h" | 5 #include "chrome/browser/task_manager/os_resource_win.h" |
| 6 |
| 7 namespace task_manager { |
6 | 8 |
7 void GetWinGDIHandles(base::ProcessHandle process, | 9 void GetWinGDIHandles(base::ProcessHandle process, |
8 size_t* current, | 10 size_t* current, |
9 size_t* peak) { | 11 size_t* peak) { |
10 *current = 0; | 12 *current = 0; |
11 *peak = 0; | 13 *peak = 0; |
12 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights. | 14 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights. |
13 HANDLE current_process = GetCurrentProcess(); | 15 HANDLE current_process = GetCurrentProcess(); |
14 HANDLE process_with_query_rights; | 16 HANDLE process_with_query_rights; |
15 if (DuplicateHandle(current_process, process, current_process, | 17 if (DuplicateHandle(current_process, process, current_process, |
(...skipping 14 matching lines...) Expand all Loading... |
30 HANDLE current_process = GetCurrentProcess(); | 32 HANDLE current_process = GetCurrentProcess(); |
31 HANDLE process_with_query_rights; | 33 HANDLE process_with_query_rights; |
32 if (DuplicateHandle(current_process, process, current_process, | 34 if (DuplicateHandle(current_process, process, current_process, |
33 &process_with_query_rights, PROCESS_QUERY_INFORMATION, | 35 &process_with_query_rights, PROCESS_QUERY_INFORMATION, |
34 false, 0)) { | 36 false, 0)) { |
35 *current = GetGuiResources(process_with_query_rights, GR_USEROBJECTS); | 37 *current = GetGuiResources(process_with_query_rights, GR_USEROBJECTS); |
36 *peak = GetGuiResources(process_with_query_rights, GR_USEROBJECTS_PEAK); | 38 *peak = GetGuiResources(process_with_query_rights, GR_USEROBJECTS_PEAK); |
37 CloseHandle(process_with_query_rights); | 39 CloseHandle(process_with_query_rights); |
38 } | 40 } |
39 } | 41 } |
| 42 |
| 43 } // namespace task_manager |
OLD | NEW |