OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ |
| 6 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <string> |
| 11 |
| 12 #include "base/files/file.h" |
| 13 #include "components/browser_watcher/stability_report.pb.h" |
| 14 #include "third_party/crashpad/crashpad/util/misc/uuid.h" |
| 15 |
| 16 namespace browser_watcher { |
| 17 |
| 18 // Minidump information required by the Crashpad reporter. |
| 19 struct MinidumpInfo { |
| 20 crashpad::UUID client_id; // The client's identifier. |
| 21 crashpad::UUID report_id; // The report's identifier. |
| 22 std::string product_name; // The product name to be used by the reporter. |
| 23 std::string version_number; // The product's version number. |
| 24 }; |
| 25 |
| 26 // Write to |minidump_file| a minimal minidump that wraps |report|. Returns |
| 27 // true on success, false otherwise. |
| 28 // Note: the caller owns |minidump_file| and is responsible for keeping it valid |
| 29 // for this function's duration. |minidump_file| is expected to be empty |
| 30 // and a binary stream. |
| 31 bool WritePostmortemDump(base::PlatformFile minidump_file, |
| 32 const StabilityReport& report, |
| 33 const MinidumpInfo& minidump_info); |
| 34 |
| 35 } // namespace browser_watcher |
| 36 |
| 37 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ |
OLD | NEW |