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

Side by Side Diff: base/process_util_win.cc

Issue 3086: * Change output of trace_event log to JSON to enable easier integration with ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 3 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
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 7 #include <windows.h>
8 #include <winternl.h> 8 #include <winternl.h>
9 #include <psapi.h> 9 #include <psapi.h>
10 10
(...skipping 10 matching lines...) Expand all
21 typedef BOOL (WINAPI* HeapSetFn)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T); 21 typedef BOOL (WINAPI* HeapSetFn)(HANDLE, HEAP_INFORMATION_CLASS, PVOID, SIZE_T);
22 22
23 } // namespace 23 } // namespace
24 24
25 namespace process_util { 25 namespace process_util {
26 26
27 int GetCurrentProcId() { 27 int GetCurrentProcId() {
28 return ::GetCurrentProcessId(); 28 return ::GetCurrentProcessId();
29 } 29 }
30 30
31 ProcessHandle GetCurrentProcessHandle() {
32 return ::GetCurrentProcess();
33 }
34
31 // Helper for GetProcId() 35 // Helper for GetProcId()
32 bool GetProcIdViaGetProcessId(ProcessHandle process, DWORD* id) { 36 bool GetProcIdViaGetProcessId(ProcessHandle process, DWORD* id) {
33 // Dynamically get a pointer to GetProcessId(). 37 // Dynamically get a pointer to GetProcessId().
34 typedef DWORD (WINAPI *GetProcessIdFunction)(HANDLE); 38 typedef DWORD (WINAPI *GetProcessIdFunction)(HANDLE);
35 static GetProcessIdFunction GetProcessIdPtr = NULL; 39 static GetProcessIdFunction GetProcessIdPtr = NULL;
36 static bool initialize_get_process_id = true; 40 static bool initialize_get_process_id = true;
37 if (initialize_get_process_id) { 41 if (initialize_get_process_id) {
38 initialize_get_process_id = false; 42 initialize_get_process_id = false;
39 HMODULE kernel32_handle = GetModuleHandle(L"kernel32.dll"); 43 HMODULE kernel32_handle = GetModuleHandle(L"kernel32.dll");
40 if (!kernel32_handle) { 44 if (!kernel32_handle) {
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 sizeof(lfh_flag)); 596 sizeof(lfh_flag));
593 } 597 }
594 return true; 598 return true;
595 } 599 }
596 600
597 void RaiseProcessToHighPriority() { 601 void RaiseProcessToHighPriority() {
598 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); 602 SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
599 } 603 }
600 604
601 } // namespace process_util 605 } // namespace process_util
OLDNEW
« no previous file with comments | « base/process_util_posix.cc ('k') | base/trace_event.h » ('j') | tools/trace/trace_data.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698