OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/browser_child_process_host.h" | 5 #include "content/browser/browser_child_process_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 void BrowserChildProcessHost::Notify(int type) { | 125 void BrowserChildProcessHost::Notify(int type) { |
126 BrowserThread::PostTask( | 126 BrowserThread::PostTask( |
127 BrowserThread::UI, | 127 BrowserThread::UI, |
128 FROM_HERE, | 128 FROM_HERE, |
129 base::Bind(&ChildNotificationHelper, type, data_)); | 129 base::Bind(&ChildNotificationHelper, type, data_)); |
130 } | 130 } |
131 | 131 |
132 base::TerminationStatus BrowserChildProcessHost::GetChildTerminationStatus( | 132 base::TerminationStatus BrowserChildProcessHost::GetChildTerminationStatus( |
133 int* exit_code) { | 133 int* exit_code) { |
| 134 if (!child_process_.get()) // If the delegate doesn't use Launch() helper. |
| 135 return base::GetTerminationStatus(handle(), exit_code); |
134 return child_process_->GetChildTerminationStatus(exit_code); | 136 return child_process_->GetChildTerminationStatus(exit_code); |
135 } | 137 } |
136 | 138 |
137 bool BrowserChildProcessHost::OnMessageReceived(const IPC::Message& message) { | 139 bool BrowserChildProcessHost::OnMessageReceived(const IPC::Message& message) { |
138 return false; | 140 return false; |
139 } | 141 } |
140 | 142 |
141 void BrowserChildProcessHost::OnChannelConnected(int32 peer_pid) { | 143 void BrowserChildProcessHost::OnChannelConnected(int32 peer_pid) { |
142 Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED); | 144 Notify(content::NOTIFICATION_CHILD_PROCESS_HOST_CONNECTED); |
143 } | 145 } |
(...skipping 23 matching lines...) Expand all Loading... |
167 this->type(), | 169 this->type(), |
168 content::PROCESS_TYPE_MAX); | 170 content::PROCESS_TYPE_MAX); |
169 if (disconnect_was_alive_) { | 171 if (disconnect_was_alive_) { |
170 UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive", | 172 UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive", |
171 this->type(), | 173 this->type(), |
172 content::PROCESS_TYPE_MAX); | 174 content::PROCESS_TYPE_MAX); |
173 } | 175 } |
174 break; | 176 break; |
175 } | 177 } |
176 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { | 178 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { |
177 OnProcessWasKilled(exit_code); | |
178 // Report that this child process was killed. | 179 // Report that this child process was killed. |
179 Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED); | |
180 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed", | 180 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed", |
181 this->type(), | 181 this->type(), |
182 content::PROCESS_TYPE_MAX); | 182 content::PROCESS_TYPE_MAX); |
183 if (disconnect_was_alive_) { | 183 if (disconnect_was_alive_) { |
184 UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive", | 184 UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive", |
185 this->type(), | 185 this->type(), |
186 content::PROCESS_TYPE_MAX); | 186 content::PROCESS_TYPE_MAX); |
187 } | 187 } |
188 break; | 188 break; |
189 } | 189 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 return *iterator_; | 294 return *iterator_; |
295 } while (true); | 295 } while (true); |
296 | 296 |
297 return NULL; | 297 return NULL; |
298 } | 298 } |
299 | 299 |
300 bool BrowserChildProcessHost::Iterator::Done() { | 300 bool BrowserChildProcessHost::Iterator::Done() { |
301 return iterator_ == g_child_process_list.Get().end(); | 301 return iterator_ == g_child_process_list.Get().end(); |
302 } | 302 } |
OLD | NEW |