Using process handle from RenderProcessHost

This commit is contained in:
Hari Krishna Reddy Juturu 2017-05-19 21:28:52 -07:00
parent de5eaf9336
commit e5a9ef296d
2 changed files with 7 additions and 7 deletions

View file

@ -686,7 +686,7 @@ void App::BrowserChildProcessLaunchedAndConnected(
const content::ChildProcessData& data) {
this->ChildProcessLaunched(
data.process_type,
base::GetProcId(data.handle));
data.handle);
}
void App::BrowserChildProcessHostDisconnected(
@ -699,7 +699,7 @@ void App::RenderProcessReady(
content::RenderProcessHost* host) {
this->ChildProcessLaunched(
content::PROCESS_TYPE_RENDERER,
base::GetProcId(host->GetHandle()));
host->GetHandle());
}
void App::RenderProcessDisconnected(
@ -710,16 +710,16 @@ void App::RenderProcessDisconnected(
void App::ChildProcessLaunched(
int process_type,
base::ProcessId pid) {
auto process = base::Process::OpenWithExtraPrivileges(pid);
base::ProcessHandle handle) {
auto pid = base::GetProcId(handle);
#if defined(OS_MACOSX)
std::unique_ptr<base::ProcessMetrics> metrics(
base::ProcessMetrics::CreateProcessMetrics(
process.Handle(), content::BrowserChildProcessHost::GetPortProvider()));
handle, content::BrowserChildProcessHost::GetPortProvider()));
#else
std::unique_ptr<base::ProcessMetrics> metrics(
base::ProcessMetrics::CreateProcessMetrics(process.Handle()));
base::ProcessMetrics::CreateProcessMetrics(handle));
#endif
std::unique_ptr<atom::ProcessMetric> process_metric(
new atom::ProcessMetric(

View file

@ -148,7 +148,7 @@ class App : public AtomBrowserClient::Delegate,
void SetAppPath(const base::FilePath& app_path);
void ChildProcessLaunched(
int process_type,
base::ProcessId id);
base::ProcessHandle handle);
void ChildProcessDisconnected(
base::ProcessId pid);