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

Side by Side Diff: components/browser_watcher/postmortem_minidump_writer.h

Issue 2327043002: A simple minidump writer for postmortem stability reports. (Closed)
Patch Set: Address comments Created 4 years, 3 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 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 <map>
scottmg 2016/09/13 21:32:37 Many of these includes can move into the .cc now.
manzagop (departed) 2016/09/14 13:44:36 Thanks for catching. Done.
11 #include <memory>
12 #include <string>
13 #include <type_traits>
14 #include <vector>
15
16 #include "base/files/file.h"
17 #include "base/macros.h"
18 #include "base/strings/string_piece.h"
19 #include "components/browser_watcher/stability_report.pb.h"
20 #include "third_party/crashpad/crashpad/minidump/minidump_extensions.h"
21 #include "third_party/crashpad/crashpad/util/misc/uuid.h"
22
23 namespace browser_watcher {
24
25 // Minidump information required by the Crashpad reporter.
26 struct MinidumpInfo {
27 crashpad::UUID client_id; // The client's identifier.
28 crashpad::UUID report_id; // The report's identifier.
29 std::string product_name; // The product name to be used by the reporter.
30 std::string version_number; // The product's version number.
31 };
32
33 // Write to |minidump_file| a minimal minidump that wraps |report|. Returns
34 // true on success, false otherwise.
35 // Note: the caller owns |minidump_file| and is responsible for keeping it valid
36 // for this function's duration. |minidump_file| is expected to be empty
37 // and a binary stream.
38 bool WritePostmortemDump(base::PlatformFile minidump_file,
39 const StabilityReport& report,
40 const MinidumpInfo& minidump_info);
41
42 } // namespace browser_watcher
43
44 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698