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

Unified Diff: chrome/browser/chrome_child_process_watcher.cc

Issue 1067733006: Add extra parameter to BrowserChildProcessCrashed to pass the exit_code at time of crash/termination (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review comments Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chrome_child_process_watcher.cc
diff --git a/chrome/browser/chrome_child_process_watcher.cc b/chrome/browser/chrome_child_process_watcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..77367e945a3c69932e0c6b79257d606e7dc1ed78
--- /dev/null
+++ b/chrome/browser/chrome_child_process_watcher.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chrome_child_process_watcher.h"
+
+#include "base/command_line.h"
+#include "base/metrics/histogram.h"
+#include "chrome/common/chrome_result_codes.h"
+#include "chrome/common/chrome_switches.h"
+#include "content/public/browser/browser_child_process_observer.h"
+#include "content/public/browser/child_process_data.h"
+
+namespace {
+
+void AnalyzeCrash(int exit_code) {
+ if (exit_code == chrome::RESULT_CODE_INVALID_SANDBOX_STATE) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ const bool no_startup_window =
+ command_line->HasSwitch(switches::kNoStartupWindow);
+ UMA_HISTOGRAM_BOOLEAN(
+ "ChildProcess.InvalidSandboxStateCrash.NoStartupWindow",
+ no_startup_window);
+ }
+}
+
+} // namespace
+
+ChromeChildProcessWatcher::ChromeChildProcessWatcher() {
+ BrowserChildProcessObserver::Add(this);
+}
+
+ChromeChildProcessWatcher::~ChromeChildProcessWatcher() {
+ BrowserChildProcessObserver::Remove(this);
+}
+
+void ChromeChildProcessWatcher::BrowserChildProcessCrashed(
+ const content::ChildProcessData& data,
+ int exit_code) {
+ AnalyzeCrash(exit_code);
+}
« no previous file with comments | « chrome/browser/chrome_child_process_watcher.h ('k') | chrome/browser/metrics/chrome_stability_metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698