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

Unified Diff: third_party/crashpad/crashpad/client/crash_report_database_win.cc

Issue 2825103002: Update Crashpad to b8aaa22905308cc400f880006a84dddac834bd6b (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/client/crash_report_database_win.cc
diff --git a/third_party/crashpad/crashpad/client/crash_report_database_win.cc b/third_party/crashpad/crashpad/client/crash_report_database_win.cc
index 6629d25d48aa0996fd705df7ab357145ea80ff91..a97b1cf079698676003c07df56f39e2a043c9ae4 100644
--- a/third_party/crashpad/crashpad/client/crash_report_database_win.cc
+++ b/third_party/crashpad/crashpad/client/crash_report_database_win.cc
@@ -242,8 +242,9 @@ class Metadata {
//! written to disk via Write().
//!
//! \return #kNoError on success. #kReportNotFound if there was no report with
- //! the specified UUID. #kBusyError if the report was not in the specified
- //! state.
+ //! the specified UUID, or if the report was not in the specified state
+ //! and was not uploading. #kBusyError if the report was not in the
+ //! specified state and was uploading.
OperationStatus FindSingleReportAndMarkDirty(const UUID& uuid,
ReportState desired_state,
ReportDisk** report_disk);
@@ -530,9 +531,13 @@ OperationStatus Metadata::VerifyReportAnyState(const ReportDisk& report_disk) {
// static
OperationStatus Metadata::VerifyReport(const ReportDisk& report_disk,
ReportState desired_state) {
- return (report_disk.state == desired_state)
- ? VerifyReportAnyState(report_disk)
- : CrashReportDatabase::kBusyError;
+ if (report_disk.state == desired_state) {
+ return VerifyReportAnyState(report_disk);
+ }
+
+ return report_disk.state == ReportState::kUploading
+ ? CrashReportDatabase::kBusyError
+ : CrashReportDatabase::kReportNotFound;
}
bool EnsureDirectory(const base::FilePath& path) {
@@ -876,7 +881,7 @@ OperationStatus CrashReportDatabaseWin::RequestUpload(const UUID& uuid) {
// TODO(gayane): Search for the report only once regardless of its state.
OperationStatus os = metadata->FindSingleReportAndMarkDirty(
uuid, ReportState::kCompleted, &report_disk);
- if (os == kBusyError) {
+ if (os == kReportNotFound) {
os = metadata->FindSingleReportAndMarkDirty(
uuid, ReportState::kPending, &report_disk);
}

Powered by Google App Engine
This is Rietveld 408576698