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

Unified Diff: src/platform/crash/crash_dumper.h

Issue 2128004: Adding in-process crash dumping library and crash uploader (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: respond to review and add another test Created 10 years, 7 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
« no previous file with comments | « src/platform/crash/Makefile ('k') | src/platform/crash/crash_dumper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/crash/crash_dumper.h
diff --git a/src/platform/crash/crash_dumper.h b/src/platform/crash/crash_dumper.h
new file mode 100644
index 0000000000000000000000000000000000000000..4dafbeb00f462ac000e1f31f87d95061b6d80018
--- /dev/null
+++ b/src/platform/crash/crash_dumper.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CRASH_CRASH_DUMPER_H_
+#define CRASH_CRASH_DUMPER_H_
+
+#include <string>
+
+#include "base/scoped_ptr.h"
+
+namespace google_breakpad {
+class ExceptionHandler;
+}
+
+class FilePath;
+
+// Class to manage crash handling and dumping. When Enable is called, all
+// crashes will be caught and stored to the appropriate crash directory.
+// The directory will be:
+// /home/chronos/user/crash - for all processes running as chronos
+// /var/spool/crash - for all other processes
+// The class takes care of creating the directories (even recreating them
+// at crash time in case the cryptohome mounting changes from Enable time.
+
+class CrashDumper {
+ public:
+ ~CrashDumper() {
+ if (IsEnabled()) {
+ Disable();
+ }
+ }
+
+ // Enable crash detection and dumping. Aborts if already enabled
+ // or crash reporting cannot be enabled. If the cryptohome is mounted
+ // while crash handling is enabled, later crashes may be lost.
+ static void Enable();
+
+ // Return if enabled.
+ static bool IsEnabled();
+
+ // Disable crash detection and dumping. Aborts if not enabled.
+ static void Disable();
+};
+
+#endif // CRASH_CRASH_DUMPER_H_
« no previous file with comments | « src/platform/crash/Makefile ('k') | src/platform/crash/crash_dumper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698