| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/task_management/providers/child_process_task_provider.h
" | 5 #include "chrome/browser/task_management/providers/child_process_task_provider.h
" |
| 6 | 6 |
| 7 #include "base/process/process.h" | 7 #include "base/process/process.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/task_management/providers/child_process_task.h" | 9 #include "chrome/browser/task_management/providers/child_process_task.h" |
| 10 #include "content/public/browser/browser_child_process_host_iterator.h" | 10 #include "content/public/browser/browser_child_process_host_iterator.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 } | 137 } |
| 138 | 138 |
| 139 void ChildProcessTaskProvider::DeleteTask(base::ProcessHandle handle) { | 139 void ChildProcessTaskProvider::DeleteTask(base::ProcessHandle handle) { |
| 140 auto itr = tasks_by_handle_.find(handle); | 140 auto itr = tasks_by_handle_.find(handle); |
| 141 | 141 |
| 142 // The following case should never happen since we start observing | 142 // The following case should never happen since we start observing |
| 143 // |BrowserChildProcessObserver| only after we collect all pre-existing child | 143 // |BrowserChildProcessObserver| only after we collect all pre-existing child |
| 144 // processes and are notified (on the UI thread) that the collection is | 144 // processes and are notified (on the UI thread) that the collection is |
| 145 // completed at |ChildProcessDataCollected()|. | 145 // completed at |ChildProcessDataCollected()|. |
| 146 if (itr == tasks_by_handle_.end()) { | 146 if (itr == tasks_by_handle_.end()) { |
| 147 NOTREACHED(); | 147 // BUG(crbug.com/611067): Temporarily removing due to test flakes. The |
| 148 // reason why this happens is well understood (see bug), but there's no |
| 149 // quick and easy fix. |
| 150 // NOTREACHED(); |
| 148 return; | 151 return; |
| 149 } | 152 } |
| 150 | 153 |
| 151 ChildProcessTask* task = itr->second; | 154 ChildProcessTask* task = itr->second; |
| 152 | 155 |
| 153 NotifyObserverTaskRemoved(task); | 156 NotifyObserverTaskRemoved(task); |
| 154 | 157 |
| 155 // Finally delete the task. | 158 // Finally delete the task. |
| 156 tasks_by_handle_.erase(itr); | 159 tasks_by_handle_.erase(itr); |
| 157 tasks_by_pid_.erase(task->process_id()); | 160 tasks_by_pid_.erase(task->process_id()); |
| 158 delete task; | 161 delete task; |
| 159 } | 162 } |
| 160 | 163 |
| 161 } // namespace task_management | 164 } // namespace task_management |
| OLD | NEW |