| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void BrowserChildProcessHost::OnChildDisconnected() { | 142 void BrowserChildProcessHost::OnChildDisconnected() { |
| 143 DCHECK(handle() != base::kNullProcessHandle); | 143 DCHECK(handle() != base::kNullProcessHandle); |
| 144 int exit_code; | 144 int exit_code; |
| 145 base::TerminationStatus status = GetChildTerminationStatus(&exit_code); | 145 base::TerminationStatus status = GetChildTerminationStatus(&exit_code); |
| 146 switch (status) { | 146 switch (status) { |
| 147 case base::TERMINATION_STATUS_PROCESS_CRASHED: | 147 case base::TERMINATION_STATUS_PROCESS_CRASHED: |
| 148 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { | 148 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { |
| 149 OnProcessCrashed(exit_code); | 149 OnProcessCrashed(exit_code); |
| 150 // Report that this child process crashed. | 150 // Report that this child process crashed. |
| 151 Notify(content::NOTIFICATION_CHILD_PROCESS_CRASHED); | 151 Notify(content::NOTIFICATION_CHILD_PROCESS_CRASHED); |
| 152 UMA_HISTOGRAM_COUNTS("ChildProcess.Crashes", this->type()); | 152 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Crashed", |
| 153 this->type(), MAX_PROCESS); |
| 153 if (disconnect_was_alive_) { | 154 if (disconnect_was_alive_) { |
| 154 UMA_HISTOGRAM_COUNTS("ChildProcess.CrashesWasAlive", this->type()); | 155 UMA_HISTOGRAM_ENUMERATION("ChildProcess.CrashedWasAlive", |
| 156 this->type(), MAX_PROCESS); |
| 155 } | 157 } |
| 156 break; | 158 break; |
| 157 } | 159 } |
| 158 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { | 160 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: { |
| 159 OnProcessWasKilled(exit_code); | 161 OnProcessWasKilled(exit_code); |
| 160 // Report that this child process was killed. | 162 // Report that this child process was killed. |
| 161 Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED); | 163 Notify(content::NOTIFICATION_CHILD_PROCESS_WAS_KILLED); |
| 162 UMA_HISTOGRAM_COUNTS("ChildProcess.Kills", this->type()); | 164 UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed", |
| 165 this->type(), MAX_PROCESS); |
| 163 if (disconnect_was_alive_) { | 166 if (disconnect_was_alive_) { |
| 164 UMA_HISTOGRAM_COUNTS("ChildProcess.KillsWasAlive", this->type()); | 167 UMA_HISTOGRAM_ENUMERATION("ChildProcess.KilledWasAlive", |
| 168 this->type(), MAX_PROCESS); |
| 165 } | 169 } |
| 166 break; | 170 break; |
| 167 } | 171 } |
| 168 case base::TERMINATION_STATUS_STILL_RUNNING: { | 172 case base::TERMINATION_STATUS_STILL_RUNNING: { |
| 169 // exit code not yet available. | 173 // exit code not yet available. |
| 170 disconnect_was_alive_ = true; | 174 disconnect_was_alive_ = true; |
| 171 #if defined(OS_WIN) | 175 #if defined(OS_WIN) |
| 172 child_watcher_.StartWatching(new base::WaitableEvent(handle()), this); | 176 child_watcher_.StartWatching(new base::WaitableEvent(handle()), this); |
| 173 return; | 177 return; |
| 174 #else | 178 #else |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 252 |
| 249 return *iterator_; | 253 return *iterator_; |
| 250 } while (true); | 254 } while (true); |
| 251 | 255 |
| 252 return NULL; | 256 return NULL; |
| 253 } | 257 } |
| 254 | 258 |
| 255 bool BrowserChildProcessHost::Iterator::Done() { | 259 bool BrowserChildProcessHost::Iterator::Done() { |
| 256 return iterator_ == g_child_process_list.Get().end(); | 260 return iterator_ == g_child_process_list.Get().end(); |
| 257 } | 261 } |
| OLD | NEW |