| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 // Implementation of the collection of a stability file to a protocol buffer. | 5 // Implementation of the collection of a stability file to a protocol buffer. |
| 6 | 6 |
| 7 #ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ | 7 #ifndef COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ |
| 8 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ | 8 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "components/browser_watcher/stability_report.pb.h" | 11 #include "components/browser_watcher/stability_report.pb.h" |
| 12 | 12 |
| 13 namespace browser_watcher { | 13 namespace browser_watcher { |
| 14 | 14 |
| 15 // DO NOT CHANGE VALUES. This is logged persistently in a histogram. | 15 // DO NOT CHANGE VALUES. This is logged persistently in a histogram. |
| 16 enum CollectionStatus { | 16 enum CollectionStatus { |
| 17 NONE = 0, | 17 NONE = 0, |
| 18 SUCCESS = 1, // Successfully registered a report with Crashpad. | 18 SUCCESS = 1, // Successfully registered a report with Crashpad. |
| 19 ANALYZER_CREATION_FAILED = 2, | 19 ANALYZER_CREATION_FAILED = 2, |
| 20 DEBUG_FILE_NO_DATA = 3, | 20 DEBUG_FILE_NO_DATA = 3, |
| 21 PREPARE_NEW_CRASH_REPORT_FAILED = 4, | 21 PREPARE_NEW_CRASH_REPORT_FAILED = 4, |
| 22 WRITE_TO_MINIDUMP_FAILED = 5, | 22 WRITE_TO_MINIDUMP_FAILED = 5, |
| 23 DEBUG_FILE_DELETION_FAILED = 6, | 23 DEBUG_FILE_DELETION_FAILED = 6, |
| 24 FINISHED_WRITING_CRASH_REPORT_FAILED = 7, | 24 FINISHED_WRITING_CRASH_REPORT_FAILED = 7, |
| 25 COLLECTION_STATUS_MAX = 8 | 25 ALLOCATOR_CORRUPT = 8, |
| 26 ALLOCATOR_UNINITIALIZED = 9, |
| 27 ALLOCATOR_DELETED = 10, |
| 28 COLLECTION_STATUS_MAX = 11 |
| 26 }; | 29 }; |
| 27 | 30 |
| 28 // Extracts a stability report from a stability file. | 31 // Extracts a stability report from a stability file. |
| 29 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead | 32 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead |
| 30 // and simplify testing. | 33 // and simplify testing. |
| 31 CollectionStatus Extract(const base::FilePath& stability_file, | 34 CollectionStatus Extract(const base::FilePath& stability_file, |
| 32 StabilityReport* report); | 35 StabilityReport* report); |
| 33 | 36 |
| 34 } // namespace browser_watcher | 37 } // namespace browser_watcher |
| 35 | 38 |
| 36 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ | 39 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ |
| OLD | NEW |