| OLD | NEW |
| (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/macros.h" | |
| 13 #include "base/process/process.h" | |
| 14 #include "base/threading/platform_thread.h" | |
| 15 | |
| 16 namespace crash_reporter { | |
| 17 | |
| 18 // In the fallback crash handler, this invokes the system crash machinery | |
| 19 // (MiniDumpWriteDump) to generate the crash report, then adds the report to | |
| 20 // the Crashpad database for upload. | |
| 21 class FallbackCrashHandler { | |
| 22 public: | |
| 23 FallbackCrashHandler(); | |
| 24 ~FallbackCrashHandler(); | |
| 25 | |
| 26 // Parses |cmd_line| for the following arguments: | |
| 27 // --database=<path> | |
| 28 // Path to the Crashpad database where the minidump will be stored. | |
| 29 // --exception-pointers=<address> | |
| 30 // Address of exception pointers in the crashed process. | |
| 31 // --process=<handle> | |
| 32 // Handle to the process to dump. | |
| 33 // --thread=<id> | |
| 34 // ID of the crashing thread. | |
| 35 bool ParseCommandLine(const base::CommandLine& cmd_line); | |
| 36 | |
| 37 // Generates a crashdump with Crashpad properties containing: | |
| 38 // prod: |product| | |
| 39 // ver: |version| | |
| 40 // channel: |cannel| | |
| 41 // plat: "Win32" or "Win64", depending on bitness. | |
| 42 // ptype: |process_type|. | |
| 43 bool GenerateCrashDump(const std::string& product, | |
| 44 const std::string& version, | |
| 45 const std::string& channel, | |
| 46 const std::string& process_type); | |
| 47 | |
| 48 private: | |
| 49 base::Process process_; | |
| 50 base::PlatformThreadId thread_id_; | |
| 51 // This is a pointer in process_, which is hopefully not this process. | |
| 52 uintptr_t exception_ptrs_; | |
| 53 base::FilePath database_dir_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(FallbackCrashHandler); | |
| 56 }; | |
| 57 | |
| 58 } // namespace crash_reporter | |
| 59 | |
| 60 #endif // COMPONENTS_CRASH_CONTENT_APP_FALLBACK_CRASH_HANDLER_WIN_H_ | |
| OLD | NEW |