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

Side by Side Diff: components/crash/content/app/fallback_crash_handler_win.h

Issue 2611393002: Part two of fallback crash handler for Crashpad handler process. (Closed)
Patch Set: Make CommandLine param to ParseCommandLine const. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_
6 #define COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_
7
8 #include <windows.h>
9
10 #include "base/command_line.h"
11 #include "base/files/file_path.h"
12 #include "base/process/process.h"
13 #include "base/threading/platform_thread.h"
14
15 namespace crash_reporter {
16
17 // In the fallback crash handler, this invokes the system crash machinery
18 // (MiniDumpWriteDump) to generate the crash report, then adds the report to
19 // the Crashpad database for upload.
20 class FallbackCrashHandler {
21 public:
22 FallbackCrashHandler();
23 ~FallbackCrashHandler();
24
25 // Parses |cmd_line| for the following arguments:
26 // --database=<path>
27 // Path to the Crashpad database where the minidump will be stored.
28 // --exception-pointers=<address>
29 // Address of exception pointers in the crashed process.
30 // --process=<handle>
31 // Handle to the process to dump.
32 // --thread=<id>
33 // ID of the crashing thread.
34 bool ParseCommandLine(const base::CommandLine& cmd_line);
35
36 // Generates a crashdump with Crashpad properties containing:
37 // prod: |product|
38 // ver: |version|
39 // channel: |cannel|
40 // plat: "Win32" or "Win64", depending on bitness.
41 // ptype: |process_type|.
42 bool GenerateCrashDump(const std::string& product,
43 const std::string& version,
44 const std::string& channel,
45 const std::string& process_type);
46
47 private:
48 base::Process process_;
49 base::PlatformThreadId thread_id_;
50 // This pointer is in the address space of process_, not our own.
51 EXCEPTION_POINTERS* exc_ptrs_;
scottmg 2017/01/10 18:26:28 I would prefer this to be maintained as a uint64_t
Sigurður Ásgeirsson 2017/01/10 21:21:41 Done.
52 base::FilePath database_dir_;
53 };
scottmg 2017/01/10 18:26:28 #include "base/macros.h" and DISALLOW_COPY_AND_ASS
Sigurður Ásgeirsson 2017/01/10 21:21:41 Done.
54
55 } // namespace crash_reporter
56
57 #endif // COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698