forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A simple minidump writer for postmortem stability reports.
Enables writing a minimal minidump for wrapping a StabilityReport protocol buffer. The minidump is meant to be valid for registration with the Crashpad reporter (includes the Crashpad info stream). BUG=620813 Review-Url: https://codereview.chromium.org/2327043002 Cr-Commit-Position: refs/heads/master@{#418863}
- Loading branch information
Showing
6 changed files
with
711 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
include_rules = [ | ||
"+components/metrics" | ||
"+components/metrics", | ||
"+third_party/crashpad/crashpad", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright 2016 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ | ||
#define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ | ||
|
||
#include <stdint.h> | ||
|
||
#include <string> | ||
|
||
#include "base/files/file.h" | ||
#include "components/browser_watcher/stability_report.pb.h" | ||
#include "third_party/crashpad/crashpad/util/misc/uuid.h" | ||
|
||
namespace browser_watcher { | ||
|
||
// Minidump information required by the Crashpad reporter. | ||
struct MinidumpInfo { | ||
crashpad::UUID client_id; // The client's identifier. | ||
crashpad::UUID report_id; // The report's identifier. | ||
std::string product_name; // The product name to be used by the reporter. | ||
std::string version_number; // The product's version number. | ||
}; | ||
|
||
// Write to |minidump_file| a minimal minidump that wraps |report|. Returns | ||
// true on success, false otherwise. | ||
// Note: the caller owns |minidump_file| and is responsible for keeping it valid | ||
// for this function's duration. |minidump_file| is expected to be empty | ||
// and a binary stream. | ||
bool WritePostmortemDump(base::PlatformFile minidump_file, | ||
const StabilityReport& report, | ||
const MinidumpInfo& minidump_info); | ||
|
||
} // namespace browser_watcher | ||
|
||
#endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_MINIDUMP_WRITER_H_ |
Oops, something went wrong.