From e5a9ef296d98a8fc6fb9ad228db4dbfce93edc0d Mon Sep 17 00:00:00 2001 From: Hari Krishna Reddy Juturu Date: Fri, 19 May 2017 21:28:52 -0700 Subject: [PATCH] Using process handle from RenderProcessHost --- atom/browser/api/atom_api_app.cc | 12 ++++++------ atom/browser/api/atom_api_app.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 30fd54f1ecf..4bd49731bfb 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -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 metrics( base::ProcessMetrics::CreateProcessMetrics( - process.Handle(), content::BrowserChildProcessHost::GetPortProvider())); + handle, content::BrowserChildProcessHost::GetPortProvider())); #else std::unique_ptr metrics( - base::ProcessMetrics::CreateProcessMetrics(process.Handle())); + base::ProcessMetrics::CreateProcessMetrics(handle)); #endif std::unique_ptr process_metric( new atom::ProcessMetric( diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 30f7edcbc9b..b43327c9728 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -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);