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..e31f0d1478840b3df3c3121067cea50bc938d5d2 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), |
|
afakhry
2017/01/23 17:41:55
While we are here, can you please revise the expec
Wez
2017/01/23 19:21:01
Hmmm, GetNaClPortText() doesn't need the -2 case,
|
| #endif // !defined(DISABLE_NACL) |
| idle_wakeups_per_second_(-1), |
| #if defined(OS_LINUX) |
| @@ -258,12 +258,15 @@ void TaskGroup::RefreshWindowsHandles() { |
| } |
| #if !defined(DISABLE_NACL) |
| +static int GetNaClDebugStubPort(int process_id) { |
|
afakhry
2017/01/23 17:41:55
Can you please add a DCHECK_CURRENTLY_ON(content::
Wez
2017/01/23 19:21:02
I'd prefer to express that via the name, since thi
|
| + 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())); |
| } |