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); |
} |