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

Side by Side Diff: chrome/browser/task_management/providers/child_process_task_provider.cc

Issue 1320563002: Task Manager Should remember the most recently enabled columns. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tearing Down Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/task_manager/task_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 for (auto& process_data : *child_processes) 117 for (auto& process_data : *child_processes)
118 CreateTask(process_data); 118 CreateTask(process_data);
119 119
120 // Now start observing. 120 // Now start observing.
121 BrowserChildProcessObserver::Add(this); 121 BrowserChildProcessObserver::Add(this);
122 } 122 }
123 123
124 void ChildProcessTaskProvider::CreateTask( 124 void ChildProcessTaskProvider::CreateTask(
125 const content::ChildProcessData& data) { 125 const content::ChildProcessData& data) {
126 // The following case should never happen since we start observing
127 // |BrowserChildProcessObserver| only after we collect all pre-existing child
128 // processes and are notified (on the UI thread) that the collection is
129 // completed at |ChildProcessDataCollected()|.
130 if (tasks_by_handle_.find(data.handle) != tasks_by_handle_.end()) { 126 if (tasks_by_handle_.find(data.handle) != tasks_by_handle_.end()) {
131 NOTREACHED(); 127 // This case can happen when some of the child process data we collect upon
128 // StartUpdating() might be of BrowserChildProcessHosts whose channels
129 // hadn't connected yet. So we just return.
132 return; 130 return;
133 } 131 }
134 132
135 // Create the task and notify the observer. 133 // Create the task and notify the observer.
136 ChildProcessTask* task = new ChildProcessTask(data); 134 ChildProcessTask* task = new ChildProcessTask(data);
137 tasks_by_handle_[data.handle] = task; 135 tasks_by_handle_[data.handle] = task;
138 tasks_by_pid_[task->process_id()] = task; 136 tasks_by_pid_[task->process_id()] = task;
139 NotifyObserverTaskAdded(task); 137 NotifyObserverTaskAdded(task);
140 } 138 }
141 139
(...skipping 13 matching lines...) Expand all
155 153
156 NotifyObserverTaskRemoved(task); 154 NotifyObserverTaskRemoved(task);
157 155
158 // Finally delete the task. 156 // Finally delete the task.
159 tasks_by_handle_.erase(itr); 157 tasks_by_handle_.erase(itr);
160 tasks_by_pid_.erase(task->process_id()); 158 tasks_by_pid_.erase(task->process_id());
161 delete task; 159 delete task;
162 } 160 }
163 161
164 } // namespace task_management 162 } // namespace task_management
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/task_manager/task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698