refactor: simplify child process tracking for app.getAppMetrics() (#26657)
This commit is contained in:
parent
61f339d3aa
commit
4e3e3d414d
4 changed files with 17 additions and 27 deletions
|
@ -5,9 +5,9 @@
|
|||
#ifndef SHELL_BROWSER_API_ELECTRON_API_APP_H_
|
||||
#define SHELL_BROWSER_API_ELECTRON_API_APP_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
@ -74,7 +74,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
|
||||
base::FilePath GetAppPath() const;
|
||||
void RenderProcessReady(content::RenderProcessHost* host);
|
||||
void RenderProcessDisconnected(base::ProcessId host_pid);
|
||||
void RenderProcessExited(content::RenderProcessHost* host);
|
||||
|
||||
App();
|
||||
|
||||
|
@ -167,10 +167,11 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
|
||||
void SetAppPath(const base::FilePath& app_path);
|
||||
void ChildProcessLaunched(int process_type,
|
||||
int pid,
|
||||
base::ProcessHandle handle,
|
||||
const std::string& service_name = std::string(),
|
||||
const std::string& name = std::string());
|
||||
void ChildProcessDisconnected(base::ProcessId pid);
|
||||
void ChildProcessDisconnected(int pid);
|
||||
|
||||
void SetAppLogsPath(gin_helper::ErrorThrower thrower,
|
||||
base::Optional<base::FilePath> custom_path);
|
||||
|
@ -250,8 +251,7 @@ class App : public ElectronBrowserClient::Delegate,
|
|||
base::FilePath app_path_;
|
||||
|
||||
using ProcessMetricMap =
|
||||
std::unordered_map<base::ProcessId,
|
||||
std::unique_ptr<electron::ProcessMetric>>;
|
||||
std::map<int, std::unique_ptr<electron::ProcessMetric>>;
|
||||
ProcessMetricMap app_metrics_;
|
||||
|
||||
bool disable_hw_acceleration_ = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue