Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5903)

Unified Diff: chrome/browser/task_manager/sampling/task_group.cc

Issue 2646623004: Query NaCl processes' GDB debug port on the correct thread. (Closed)
Patch Set: Fix GetNaClPortText() expectation and rename new_visibility Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..959770a005c7bd4a5413d4d97271a97de793272a 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)
@@ -258,12 +258,15 @@ void TaskGroup::RefreshWindowsHandles() {
}
#if !defined(DISABLE_NACL)
+static int GetNaClDebugStubPortOnIoThread(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(&GetNaClDebugStubPortOnIoThread, child_process_unique_id),
base::Bind(&TaskGroup::OnRefreshNaClDebugStubPortDone,
weak_ptr_factory_.GetWeakPtr()));
}

Powered by Google App Engine
This is Rietveld 408576698