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

Unified Diff: components/crash/content/app/fallback_crash_handler_win.h

Issue 2596463002: A simple, practically zero cost fallback crash handler for Crashpad handler process. (Closed)
Patch Set: Tweak comments for moar better confusion-less reading. Created 3 years, 11 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: components/crash/content/app/fallback_crash_handler_win.h
diff --git a/components/crash/content/app/fallback_crash_handler_win.h b/components/crash/content/app/fallback_crash_handler_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..b631ac6d8309104d096140f50a0e2c11ee6194a0
--- /dev/null
+++ b/components/crash/content/app/fallback_crash_handler_win.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
scottmg 2017/01/06 18:29:04 2017
Sigurður Ásgeirsson 2017/01/06 20:59:11 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_
+#define COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_
+
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "base/process/process.h"
+#include "base/threading/platform_thread.h"
+
+#include <windows.h>
scottmg 2017/01/06 18:29:04 <> before ""
Sigurður Ásgeirsson 2017/01/06 20:59:11 Done.
+
+namespace crash_reporter {
+
+// In the fallback crash handler, this invokes the system crash machinery
+// (MinidumpWriteDump) to generate the crash report, then adds the report to
scottmg 2017/01/06 18:29:04 MiniDumpWriteDump
Sigurður Ásgeirsson 2017/01/06 20:59:11 Done.
+// the Crashpad database for upload.
+// TODO(siggi):
+class FallbackCrashHandler {
+ public:
+ FallbackCrashHandler();
+ ~FallbackCrashHandler();
+
+ bool ParseCommandLine(base::CommandLine* cmd_line);
+ bool GenerateCrashDump();
+
+ private:
+ base::Process process_;
+ base::PlatformThreadId thread_id_;
+ // This pointer is in the address space of process_, not our own.
+ EXCEPTION_POINTERS* exc_ptrs_;
+ base::FilePath database_dir_;
+};
+
+} // namespace crash_reporter
+
+#endif // COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_

Powered by Google App Engine
This is Rietveld 408576698