summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_main_runner.cc
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 19:12:31 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-12 19:12:31 +0000
commit2c4cf5e01342ef029cfcee54c9f732b08f18a00c (patch)
tree98d5dd09cefb9bb44a36542731665bc06a26dbab /content/browser/browser_main_runner.cc
parent62c3bbcf8163fc27d1d5654c0536947fe0dfcb9d (diff)
downloadchromium_src-2c4cf5e01342ef029cfcee54c9f732b08f18a00c.zip
chromium_src-2c4cf5e01342ef029cfcee54c9f732b08f18a00c.tar.gz
chromium_src-2c4cf5e01342ef029cfcee54c9f732b08f18a00c.tar.bz2
Make sure unexpected exit paths generate crash dumps for the browser.
Right now it is possible for some random code to directly terminate the browser process without generating a crash dump. This CL should fix that. BUG=none TEST=none R=jam@chromium.org Review URL: https://codereview.chromium.org/22264015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/browser_main_runner.cc')
-rw-r--r--content/browser/browser_main_runner.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index cca1466..1a349a2 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -19,6 +19,7 @@
#if defined(OS_WIN)
#include "base/win/metro.h"
+#include "base/win/win_util.h"
#include "base/win/windows_version.h"
#include "ui/base/win/scoped_ole_initializer.h"
#endif
@@ -103,6 +104,13 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
if (result_code > 0)
return result_code;
+#if defined(OS_WIN)
+ // The process should crash when going through abnormal termination.
+ // Make sure this is done only when Shutdown() will be called.
+ base::win::SetShouldCrashOnProcessDetach(true);
+ base::win::SetAbortBehaviorForCrashReporting();
+#endif
+
// Return -1 to indicate no early termination.
return -1;
}
@@ -130,6 +138,10 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
notification_service_.reset(NULL);
+#if defined(OS_WIN)
+ base::win::SetShouldCrashOnProcessDetach(false);
+#endif
+
is_shutdown_ = true;
}