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

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: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698