Using process handle from RenderProcessHost
This commit is contained in:
parent
de5eaf9336
commit
e5a9ef296d
2 changed files with 7 additions and 7 deletions
|
@ -686,7 +686,7 @@ void App::BrowserChildProcessLaunchedAndConnected(
|
||||||
const content::ChildProcessData& data) {
|
const content::ChildProcessData& data) {
|
||||||
this->ChildProcessLaunched(
|
this->ChildProcessLaunched(
|
||||||
data.process_type,
|
data.process_type,
|
||||||
base::GetProcId(data.handle));
|
data.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::BrowserChildProcessHostDisconnected(
|
void App::BrowserChildProcessHostDisconnected(
|
||||||
|
@ -699,7 +699,7 @@ void App::RenderProcessReady(
|
||||||
content::RenderProcessHost* host) {
|
content::RenderProcessHost* host) {
|
||||||
this->ChildProcessLaunched(
|
this->ChildProcessLaunched(
|
||||||
content::PROCESS_TYPE_RENDERER,
|
content::PROCESS_TYPE_RENDERER,
|
||||||
base::GetProcId(host->GetHandle()));
|
host->GetHandle());
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::RenderProcessDisconnected(
|
void App::RenderProcessDisconnected(
|
||||||
|
@ -710,16 +710,16 @@ void App::RenderProcessDisconnected(
|
||||||
|
|
||||||
void App::ChildProcessLaunched(
|
void App::ChildProcessLaunched(
|
||||||
int process_type,
|
int process_type,
|
||||||
base::ProcessId pid) {
|
base::ProcessHandle handle) {
|
||||||
auto process = base::Process::OpenWithExtraPrivileges(pid);
|
auto pid = base::GetProcId(handle);
|
||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
std::unique_ptr<base::ProcessMetrics> metrics(
|
std::unique_ptr<base::ProcessMetrics> metrics(
|
||||||
base::ProcessMetrics::CreateProcessMetrics(
|
base::ProcessMetrics::CreateProcessMetrics(
|
||||||
process.Handle(), content::BrowserChildProcessHost::GetPortProvider()));
|
handle, content::BrowserChildProcessHost::GetPortProvider()));
|
||||||
#else
|
#else
|
||||||
std::unique_ptr<base::ProcessMetrics> metrics(
|
std::unique_ptr<base::ProcessMetrics> metrics(
|
||||||
base::ProcessMetrics::CreateProcessMetrics(process.Handle()));
|
base::ProcessMetrics::CreateProcessMetrics(handle));
|
||||||
#endif
|
#endif
|
||||||
std::unique_ptr<atom::ProcessMetric> process_metric(
|
std::unique_ptr<atom::ProcessMetric> process_metric(
|
||||||
new atom::ProcessMetric(
|
new atom::ProcessMetric(
|
||||||
|
|
|
@ -148,7 +148,7 @@ class App : public AtomBrowserClient::Delegate,
|
||||||
void SetAppPath(const base::FilePath& app_path);
|
void SetAppPath(const base::FilePath& app_path);
|
||||||
void ChildProcessLaunched(
|
void ChildProcessLaunched(
|
||||||
int process_type,
|
int process_type,
|
||||||
base::ProcessId id);
|
base::ProcessHandle handle);
|
||||||
void ChildProcessDisconnected(
|
void ChildProcessDisconnected(
|
||||||
base::ProcessId pid);
|
base::ProcessId pid);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue