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

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

Issue 15196003: Create task_manager namespace and wrap classes related to TaskManager with it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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 | Annotate | Revision Log
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/task_manager_os_resources_win.h"
6
7 void GetWinGDIHandles(base::ProcessHandle process,
8 size_t* current,
9 size_t* peak) {
10 *current = 0;
11 *peak = 0;
12 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights.
13 HANDLE current_process = GetCurrentProcess();
14 HANDLE process_with_query_rights;
15 if (DuplicateHandle(current_process, process, current_process,
16 &process_with_query_rights, PROCESS_QUERY_INFORMATION,
17 false, 0)) {
18 *current = GetGuiResources(process_with_query_rights, GR_GDIOBJECTS);
19 *peak = GetGuiResources(process_with_query_rights, GR_GDIOBJECTS_PEAK);
20 CloseHandle(process_with_query_rights);
21 }
22 }
23
24 void GetWinUSERHandles(base::ProcessHandle process,
25 size_t* current,
26 size_t* peak) {
27 *current = 0;
28 *peak = 0;
29 // Get a handle to |process| that has PROCESS_QUERY_INFORMATION rights.
30 HANDLE current_process = GetCurrentProcess();
31 HANDLE process_with_query_rights;
32 if (DuplicateHandle(current_process, process, current_process,
33 &process_with_query_rights, PROCESS_QUERY_INFORMATION,
34 false, 0)) {
35 *current = GetGuiResources(process_with_query_rights, GR_USEROBJECTS);
36 *peak = GetGuiResources(process_with_query_rights, GR_USEROBJECTS_PEAK);
37 CloseHandle(process_with_query_rights);
38 }
39 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698