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

Side by Side Diff: chrome/common/child_process_host.cc

Issue 468005: Improve reporting of subprocess crashes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/common/child_process_host.h" 5 #include "chrome/common/child_process_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/histogram.h"
10 #include "base/logging.h" 11 #include "base/logging.h"
11 #include "base/path_service.h" 12 #include "base/path_service.h"
12 #include "base/process_util.h" 13 #include "base/process_util.h"
13 #include "base/singleton.h" 14 #include "base/singleton.h"
14 #include "base/string_util.h" 15 #include "base/string_util.h"
15 #include "base/waitable_event.h" 16 #include "base/waitable_event.h"
16 #include "chrome/browser/chrome_thread.h" 17 #include "chrome/browser/chrome_thread.h"
17 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
18 #include "chrome/common/chrome_paths_internal.h" 19 #include "chrome/common/chrome_paths_internal.h"
19 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 ChromeThread::UI, FROM_HERE, new ChildNotificationTask(type, this)); 177 ChromeThread::UI, FROM_HERE, new ChildNotificationTask(type, this));
177 } 178 }
178 179
179 void ChildProcessHost::OnChildDied() { 180 void ChildProcessHost::OnChildDied() {
180 if (child_process_->GetHandle()) { 181 if (child_process_->GetHandle()) {
181 bool did_crash = child_process_->DidProcessCrash(); 182 bool did_crash = child_process_->DidProcessCrash();
182 if (did_crash) { 183 if (did_crash) {
183 OnProcessCrashed(); 184 OnProcessCrashed();
184 // Report that this child process crashed. 185 // Report that this child process crashed.
185 Notify(NotificationType::CHILD_PROCESS_CRASHED); 186 Notify(NotificationType::CHILD_PROCESS_CRASHED);
187 UMA_HISTOGRAM_COUNTS("ChildProcess.Crashes", this->type());
186 } 188 }
187 // Notify in the main loop of the disconnection. 189 // Notify in the main loop of the disconnection.
188 Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED); 190 Notify(NotificationType::CHILD_PROCESS_HOST_DISCONNECTED);
189 } 191 }
190 192
191 delete this; 193 delete this;
192 } 194 }
193 195
194 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host) 196 ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host)
195 : host_(host) { 197 : host_(host) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 296
295 return *iterator_; 297 return *iterator_;
296 } while (true); 298 } while (true);
297 299
298 return NULL; 300 return NULL;
299 } 301 }
300 302
301 bool ChildProcessHost::Iterator::Done() { 303 bool ChildProcessHost::Iterator::Done() {
302 return iterator_ == Singleton<ChildProcessList>::get()->end(); 304 return iterator_ == Singleton<ChildProcessList>::get()->end();
303 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698