Chromium Code Reviews| Index: chrome/browser/task_manager/sampling/task_group.cc |
| diff --git a/chrome/browser/task_manager/sampling/task_group.cc b/chrome/browser/task_manager/sampling/task_group.cc |
| index d7fab26f8d64944db4aa3da4f1b4d03a783e06c9..b40efde410d16c701063325cf13650ca05a46533 100644 |
| --- a/chrome/browser/task_manager/sampling/task_group.cc |
| +++ b/chrome/browser/task_manager/sampling/task_group.cc |
| @@ -90,7 +90,7 @@ TaskGroup::TaskGroup( |
| user_peak_handles_(-1), |
| #endif // defined(OS_WIN) |
| #if !defined(DISABLE_NACL) |
| - nacl_debug_stub_port_(-1), |
| + nacl_debug_stub_port_(nacl::kGdbDebugStubPortUnknown), |
| #endif // !defined(DISABLE_NACL) |
| idle_wakeups_per_second_(-1), |
| #if defined(OS_LINUX) |
| @@ -182,6 +182,7 @@ void TaskGroup::Refresh(const gpu::VideoMemoryUsageStats& gpu_memory_stats, |
| #if !defined(DISABLE_NACL) |
| if (TaskManagerObserver::IsResourceRefreshEnabled(REFRESH_TYPE_NACL, |
| refresh_flags) && |
| + nacl_debug_stub_port_ == nacl::kGdbDebugStubPortUnknown && |
|
Wez
2017/01/20 03:25:28
bradnelson: I thought of adding this, but I think
|
| !tasks_.empty()) { |
| RefreshNaClDebugStubPort(tasks_[0]->GetChildProcessUniqueID()); |
| } |
| @@ -258,12 +259,15 @@ void TaskGroup::RefreshWindowsHandles() { |
| } |
| #if !defined(DISABLE_NACL) |
| +static int GetNaClDebugStubPort(int process_id) { |
| + return nacl::NaClBrowser::GetInstance()->GetProcessGdbDebugStubPort( |
| + process_id); |
| +} |
| + |
| void TaskGroup::RefreshNaClDebugStubPort(int child_process_unique_id) { |
| - nacl::NaClBrowser* nacl_browser = nacl::NaClBrowser::GetInstance(); |
| content::BrowserThread::PostTaskAndReplyWithResult( |
| content::BrowserThread::IO, FROM_HERE, |
| - base::Bind(&nacl::NaClBrowser::GetProcessGdbDebugStubPort, |
| - base::Unretained(nacl_browser), child_process_unique_id), |
| + base::Bind(&GetNaClDebugStubPort, child_process_unique_id), |
| base::Bind(&TaskGroup::OnRefreshNaClDebugStubPortDone, |
| weak_ptr_factory_.GetWeakPtr())); |
| } |