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

Side by Side Diff: components/browser_watcher/stability_report_extractor.h

Issue 2923523002: Decouple stability instrumentation recording and collection (Closed)
Patch Set: PostmortemDeleter unittest Created 3 years, 6 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 unified diff | Download patch
OLDNEW
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_STABILITY_REPORT_EXTRACTOR_H_ 7 #ifndef COMPONENTS_BROWSER_WATCHER_STABILITY_REPORT_EXTRACTOR_H_
8 #define COMPONENTS_BROWSER_WATCHER_STABILITY_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 REMOVE OR REORDER 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 UNCLEAN_SHUTDOWN = 8,
26 UNCLEAN_SESSION = 9,
27 COLLECTION_ATTEMPT = 10,
28 // New values go here.
29 COLLECTION_STATUS_MAX = 11
26 }; 30 };
27 31
28 // Extracts a stability report from a stability file. 32 // Extracts a stability report from a stability file.
29 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead 33 // TODO(manzagop): have a function that takes a GlobalActivityAnalyzer instead
30 // and simplify testing. 34 // and simplify testing.
31 CollectionStatus Extract(const base::FilePath& stability_file, 35 CollectionStatus Extract(const base::FilePath& stability_file,
32 StabilityReport* report); 36 StabilityReport* report);
33 37
34 } // namespace browser_watcher 38 } // namespace browser_watcher
35 39
36 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_REPORT_EXTRACTOR_H_ 40 #endif // COMPONENTS_BROWSER_WATCHER_STABILITY_REPORT_EXTRACTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698