| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/browser_watcher/postmortem_report_collector.h" | 5 #include "components/browser_watcher/postmortem_report_collector.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 call_error_writing_crash_report.Disarm(); | 207 call_error_writing_crash_report.Disarm(); |
| 208 crashpad::UUID unused_report_id; | 208 crashpad::UUID unused_report_id; |
| 209 database_status = report_database->FinishedWritingCrashReport( | 209 database_status = report_database->FinishedWritingCrashReport( |
| 210 new_report, &unused_report_id); | 210 new_report, &unused_report_id); |
| 211 if (database_status != CrashReportDatabase::kNoError) { | 211 if (database_status != CrashReportDatabase::kNoError) { |
| 212 DLOG(ERROR) << "FinishedWritingCrashReport failed"; | 212 DLOG(ERROR) << "FinishedWritingCrashReport failed"; |
| 213 LogCollectionStatus(FINISHED_WRITING_CRASH_REPORT_FAILED); | 213 LogCollectionStatus(FINISHED_WRITING_CRASH_REPORT_FAILED); |
| 214 return false; | 214 return false; |
| 215 } | 215 } |
| 216 | 216 |
| 217 // Report collection is successful. We may increment |unclean_system_cnt|. | 217 LogCollectionStatus(SUCCESS); |
| 218 if (report_proto.system_state().session_state() == SystemState::UNCLEAN) | 218 if (report_proto.system_state().session_state() == SystemState::UNCLEAN) |
| 219 *system_unclean = true; | 219 *system_unclean = true; |
| 220 | |
| 221 return true; | 220 return true; |
| 222 } | 221 } |
| 223 | 222 |
| 224 CollectionStatus PostmortemReportCollector::CollectOneReport( | 223 CollectionStatus PostmortemReportCollector::CollectOneReport( |
| 225 const base::FilePath& file, | 224 const base::FilePath& file, |
| 226 StabilityReport* report) { | 225 StabilityReport* report) { |
| 227 DCHECK(report); | 226 DCHECK(report); |
| 228 | 227 |
| 229 CollectionStatus status = Extract(file, report); | 228 CollectionStatus status = Extract(file, report); |
| 230 if (status != SUCCESS) | 229 if (status != SUCCESS) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 StabilityReport* report, | 301 StabilityReport* report, |
| 303 const crashpad::UUID& client_id, | 302 const crashpad::UUID& client_id, |
| 304 const crashpad::UUID& report_id, | 303 const crashpad::UUID& report_id, |
| 305 base::PlatformFile minidump_file) { | 304 base::PlatformFile minidump_file) { |
| 306 DCHECK(report); | 305 DCHECK(report); |
| 307 | 306 |
| 308 return WritePostmortemDump(minidump_file, client_id, report_id, report); | 307 return WritePostmortemDump(minidump_file, client_id, report_id, report); |
| 309 } | 308 } |
| 310 | 309 |
| 311 } // namespace browser_watcher | 310 } // namespace browser_watcher |
| OLD | NEW |