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_STABILITY_REPORT_EXTRACTOR_H_ |
8 #define COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ | 8 #define COMPONENTS_BROWSER_WATCHER_STABILITY_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 COLLECTION_STATUS_MAX = 8 |
26 }; | 26 }; |
27 | 27 |
28 // Extracts a stability report from a stability file. | 28 // Extracts a stability report from a stability file. |
29 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead | 29 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead |
30 // and simplify testing. | 30 // and simplify testing. |
31 CollectionStatus Extract(const base::FilePath& stability_file, | 31 CollectionStatus Extract(const base::FilePath& stability_file, |
32 StabilityReport* report); | 32 StabilityReport* report); |
33 | 33 |
34 } // namespace browser_watcher | 34 } // namespace browser_watcher |
35 | 35 |
36 #endif // COMPONENTS_BROWSER_WATCHER_POSTMORTEM_REPORT_EXTRACTOR_H_ | 36 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_REPORT_EXTRACTOR_H_ |
OLD | NEW |