Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(941)

Side by Side Diff: chrome/browser/task_manager/os_resource_win.cc

Issue 2181493002: Return unique_ptrs from base::ProcessMetrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove os_resource_win.* Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/task_manager/os_resource_win.h"
6
7 namespace task_manager {
8
9 void GetWinGDIHandles(base::ProcessHandle process,
10 size_t* current,
11 size_t* peak) {
12 *current = 0;
13 *peak = 0;
14 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights.
15 HANDLE current_process = GetCurrentProcess();
16 HANDLE process_with_query_rights;
17 if (DuplicateHandle(current_process, process, current_process,
18 &process_with_query_rights, PROCESS_QUERY_INFORMATION,
19 false, 0)) {
20 *current = GetGuiResources(process_with_query_rights, GR_GDIOBJECTS);
21 *peak = GetGuiResources(process_with_query_rights, GR_GDIOBJECTS_PEAK);
22 CloseHandle(process_with_query_rights);
23 }
24 }
25
26 void GetWinUSERHandles(base::ProcessHandle process,
27 size_t* current,
28 size_t* peak) {
29 *current = 0;
30 *peak = 0;
31 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights.
32 HANDLE current_process = GetCurrentProcess();
33 HANDLE process_with_query_rights;
34 if (DuplicateHandle(current_process, process, current_process,
35 &process_with_query_rights, PROCESS_QUERY_INFORMATION,
36 false, 0)) {
37 *current = GetGuiResources(process_with_query_rights, GR_USEROBJECTS);
38 *peak = GetGuiResources(process_with_query_rights, GR_USEROBJECTS_PEAK);
39 CloseHandle(process_with_query_rights);
40 }
41 }
42
43 } // namespace task_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698