xref: /aosp_15_r20/external/libchrome/base/process/process_info.h (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2*635a8641SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
3*635a8641SAndroid Build Coastguard Worker // found in the LICENSE file.
4*635a8641SAndroid Build Coastguard Worker 
5*635a8641SAndroid Build Coastguard Worker #ifndef BASE_PROCESS_PROCESS_INFO_H_
6*635a8641SAndroid Build Coastguard Worker #define BASE_PROCESS_PROCESS_INFO_H_
7*635a8641SAndroid Build Coastguard Worker 
8*635a8641SAndroid Build Coastguard Worker #include "base/base_export.h"
9*635a8641SAndroid Build Coastguard Worker #include "build/build_config.h"
10*635a8641SAndroid Build Coastguard Worker 
11*635a8641SAndroid Build Coastguard Worker namespace base {
12*635a8641SAndroid Build Coastguard Worker 
13*635a8641SAndroid Build Coastguard Worker class Time;
14*635a8641SAndroid Build Coastguard Worker 
15*635a8641SAndroid Build Coastguard Worker // Vends information about the current process.
16*635a8641SAndroid Build Coastguard Worker class BASE_EXPORT CurrentProcessInfo {
17*635a8641SAndroid Build Coastguard Worker  public:
18*635a8641SAndroid Build Coastguard Worker   // Returns the time at which the process was launched. May be empty if an
19*635a8641SAndroid Build Coastguard Worker   // error occurred retrieving the information.
20*635a8641SAndroid Build Coastguard Worker   static const Time CreationTime();
21*635a8641SAndroid Build Coastguard Worker };
22*635a8641SAndroid Build Coastguard Worker 
23*635a8641SAndroid Build Coastguard Worker #if defined(OS_WIN)
24*635a8641SAndroid Build Coastguard Worker enum IntegrityLevel {
25*635a8641SAndroid Build Coastguard Worker   INTEGRITY_UNKNOWN,
26*635a8641SAndroid Build Coastguard Worker   UNTRUSTED_INTEGRITY,
27*635a8641SAndroid Build Coastguard Worker   LOW_INTEGRITY,
28*635a8641SAndroid Build Coastguard Worker   MEDIUM_INTEGRITY,
29*635a8641SAndroid Build Coastguard Worker   HIGH_INTEGRITY,
30*635a8641SAndroid Build Coastguard Worker };
31*635a8641SAndroid Build Coastguard Worker 
32*635a8641SAndroid Build Coastguard Worker // Returns the integrity level of the process. Returns INTEGRITY_UNKNOWN in the
33*635a8641SAndroid Build Coastguard Worker // case of an underlying system failure.
34*635a8641SAndroid Build Coastguard Worker BASE_EXPORT IntegrityLevel GetCurrentProcessIntegrityLevel();
35*635a8641SAndroid Build Coastguard Worker 
36*635a8641SAndroid Build Coastguard Worker // Determines whether the current process is elevated.
37*635a8641SAndroid Build Coastguard Worker BASE_EXPORT bool IsCurrentProcessElevated();
38*635a8641SAndroid Build Coastguard Worker 
39*635a8641SAndroid Build Coastguard Worker #endif  // defined(OS_WIN)
40*635a8641SAndroid Build Coastguard Worker 
41*635a8641SAndroid Build Coastguard Worker }  // namespace base
42*635a8641SAndroid Build Coastguard Worker 
43*635a8641SAndroid Build Coastguard Worker #endif  // BASE_PROCESS_PROCESS_INFO_H_
44