feat: add memory to app.getAppMetrics() (#18831)
This commit is contained in:
parent
2c383b51c1
commit
103b38650f
8 changed files with 149 additions and 1 deletions
|
@ -13,6 +13,16 @@
|
|||
|
||||
namespace electron {
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
struct ProcessMemoryInfo {
|
||||
size_t working_set_size = 0;
|
||||
size_t peak_working_set_size = 0;
|
||||
#if defined(OS_WIN)
|
||||
size_t private_bytes = 0;
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
enum class ProcessIntegrityLevel {
|
||||
Unknown,
|
||||
|
@ -33,6 +43,10 @@ struct ProcessMetric {
|
|||
std::unique_ptr<base::ProcessMetrics> metrics);
|
||||
~ProcessMetric();
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
ProcessMemoryInfo GetMemoryInfo() const;
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
ProcessIntegrityLevel GetIntegrityLevel() const;
|
||||
static bool IsSandboxed(ProcessIntegrityLevel integrity_level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue