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

Side by Side Diff: base/process/process_handle.h

Issue 2692273008: Hacky slashy (Closed)
Patch Set: wip Created 3 years, 10 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
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef BASE_PROCESS_PROCESS_HANDLE_H_ 5 #ifndef BASE_PROCESS_PROCESS_HANDLE_H_
6 #define BASE_PROCESS_PROCESS_HANDLE_H_ 6 #define BASE_PROCESS_PROCESS_HANDLE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 10
11 #include "base/base_export.h" 11 #include "base/base_export.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 14
15 #if defined(OS_WIN) 15 #if defined(OS_WIN)
16 #include <windows.h> 16 #include <windows.h>
17 #endif 17 #endif
18 18
19 namespace base { 19 namespace base {
20 20
21 // ProcessHandle is a platform specific type which represents the underlying OS 21 // ProcessHandle is a platform specific type which represents the underlying OS
22 // handle to a process. 22 // handle to a process.
23 // ProcessId is a number which identifies the process in the OS. 23 // ProcessId is a number which identifies the process in the OS.
24 #if defined(OS_WIN) 24 #if defined(OS_WIN)
25 typedef HANDLE ProcessHandle; 25 typedef HANDLE ProcessHandle;
26 typedef DWORD ProcessId; 26 typedef DWORD ProcessId;
27 typedef HANDLE UserTokenHandle; 27 typedef HANDLE UserTokenHandle;
28 const ProcessHandle kNullProcessHandle = NULL; 28 const ProcessHandle kNullProcessHandle = NULL;
29 const ProcessId kNullProcessId = 0; 29 const ProcessId kNullProcessId = 0;
30 #elif defined(OS_POSIX) 30 #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
31 // On POSIX, our ProcessHandle will just be the PID. 31 // On POSIX, our ProcessHandle will just be the PID.
32 typedef pid_t ProcessHandle; 32 typedef pid_t ProcessHandle;
33 typedef pid_t ProcessId; 33 typedef pid_t ProcessId;
34 const ProcessHandle kNullProcessHandle = 0; 34 const ProcessHandle kNullProcessHandle = 0;
35 const ProcessId kNullProcessId = 0; 35 const ProcessId kNullProcessId = 0;
36 #endif // defined(OS_WIN) 36 #endif // defined(OS_WIN)
37 37
38 // Returns the id of the current process. 38 // Returns the id of the current process.
39 // Note that on some platforms, this is not guaranteed to be unique across 39 // Note that on some platforms, this is not guaranteed to be unique across
40 // processes (use GetUniqueIdForProcess if uniqueness is required). 40 // processes (use GetUniqueIdForProcess if uniqueness is required).
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process); 72 BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process);
73 73
74 #if defined(OS_POSIX) 74 #if defined(OS_POSIX)
75 // Returns the path to the executable of the given process. 75 // Returns the path to the executable of the given process.
76 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process); 76 BASE_EXPORT FilePath GetProcessExecutablePath(ProcessHandle process);
77 #endif 77 #endif
78 78
79 } // namespace base 79 } // namespace base
80 80
81 #endif // BASE_PROCESS_PROCESS_HANDLE_H_ 81 #endif // BASE_PROCESS_PROCESS_HANDLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698