2019-06-14 22:39:55 +03:00
|
|
|
// Copyright (c) 2019 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 23:56:58 +03:00
|
|
|
#ifndef SHELL_BROWSER_API_PROCESS_METRIC_H_
|
|
|
|
#define SHELL_BROWSER_API_PROCESS_METRIC_H_
|
2019-06-14 22:39:55 +03:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "base/process/process.h"
|
|
|
|
#include "base/process/process_handle.h"
|
|
|
|
#include "base/process/process_metrics.h"
|
|
|
|
|
2019-06-20 00:23:04 +03:00
|
|
|
namespace electron {
|
2019-06-14 22:39:55 +03:00
|
|
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
enum class ProcessIntegrityLevel {
|
|
|
|
Unknown,
|
|
|
|
Untrusted,
|
|
|
|
Low,
|
|
|
|
Medium,
|
|
|
|
High,
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct ProcessMetric {
|
|
|
|
int type;
|
|
|
|
base::Process process;
|
|
|
|
std::unique_ptr<base::ProcessMetrics> metrics;
|
|
|
|
|
|
|
|
ProcessMetric(int type,
|
|
|
|
base::ProcessHandle handle,
|
|
|
|
std::unique_ptr<base::ProcessMetrics> metrics);
|
|
|
|
~ProcessMetric();
|
|
|
|
|
|
|
|
#if defined(OS_WIN)
|
|
|
|
ProcessIntegrityLevel GetIntegrityLevel() const;
|
|
|
|
static bool IsSandboxed(ProcessIntegrityLevel integrity_level);
|
|
|
|
#elif defined(OS_MACOSX)
|
|
|
|
bool IsSandboxed() const;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2019-06-20 00:23:04 +03:00
|
|
|
} // namespace electron
|
2019-06-14 22:39:55 +03:00
|
|
|
|
2019-06-19 23:56:58 +03:00
|
|
|
#endif // SHELL_BROWSER_API_PROCESS_METRIC_H_
|