diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/task_manager.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index c11b79c..b932970 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -358,9 +358,13 @@ void TaskManagerTableModel::AddResource(TaskManager::Resource* resource) { new_entry_index = static_cast<int>(iter - resources_.begin()); resources_.insert(++iter, resource); } - base::ProcessMetrics* pm = - base::ProcessMetrics::CreateProcessMetrics(process); - metrics_map_[process] = pm; + + // Create the ProcessMetrics for this process if needed (not in map). + if (metrics_map_.find(process) == metrics_map_.end()) { + base::ProcessMetrics* pm = + base::ProcessMetrics::CreateProcessMetrics(process); + metrics_map_[process] = pm; + } // Notify the table that the contents have changed for it to redraw. DCHECK(observer_); |