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

Unified Diff: components/browser_watcher/postmortem_report_collector.h

Issue 2722223002: Separate collection logic from the extraction of the report (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: components/browser_watcher/postmortem_report_collector.h
diff --git a/components/browser_watcher/postmortem_report_collector.h b/components/browser_watcher/postmortem_report_collector.h
index 0650d37ece41cd8ae99b3ebf5572822a61e63968..e1206014aa08ab9d30598354e871065d4445a96b 100644
--- a/components/browser_watcher/postmortem_report_collector.h
+++ b/components/browser_watcher/postmortem_report_collector.h
@@ -21,6 +21,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/strings/string16.h"
+#include "components/browser_watcher/postmortem_report_collector_impl.h"
Sigurður Ásgeirsson 2017/03/01 20:50:30 like we discussed, the thing you're extracting her
manzagop (departed) 2017/03/01 21:49:53 Done.
#include "components/browser_watcher/stability_report.pb.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
@@ -31,23 +32,10 @@ namespace browser_watcher {
// TODO(manzagop): UMA metrics and some error logging.
class PostmortemReportCollector {
public:
- // DO NOT CHANGE VALUES. This is logged persistently in a histogram.
- enum CollectionStatus {
- NONE = 0,
- SUCCESS = 1, // Successfully registered a report with Crashpad.
- ANALYZER_CREATION_FAILED = 2,
- DEBUG_FILE_NO_DATA = 3,
- PREPARE_NEW_CRASH_REPORT_FAILED = 4,
- WRITE_TO_MINIDUMP_FAILED = 5,
- DEBUG_FILE_DELETION_FAILED = 6,
- FINISHED_WRITING_CRASH_REPORT_FAILED = 7,
- COLLECTION_STATUS_MAX = 8
- };
-
PostmortemReportCollector(const std::string& product_name,
const std::string& version_number,
const std::string& channel_name);
- virtual ~PostmortemReportCollector() = default;
+ virtual ~PostmortemReportCollector();
// Collects postmortem stability reports from files found in |debug_info_dir|,
// relying on |debug_file_pattern| and |excluded_debug_files|. Reports are
@@ -91,18 +79,13 @@ class PostmortemReportCollector {
const base::FilePath::StringType& debug_file_pattern,
const std::set<base::FilePath>& excluded_debug_files);
- CollectionStatus CollectAndSubmit(
+ impl::CollectionStatus CollectAndSubmit(
const crashpad::UUID& client_id,
const base::FilePath& file,
crashpad::CrashReportDatabase* report_database);
- // Virtual for unittesting.
- // TODO(manzagop): move this for reuse in live scenario.
- virtual CollectionStatus Collect(const base::FilePath& debug_state_file,
- std::unique_ptr<StabilityReport>* report);
- void CollectThread(
- const base::debug::ThreadActivityAnalyzer::Snapshot& snapshot,
- ThreadState* thread_state);
+ virtual impl::CollectionStatus Collect(const base::FilePath& stability_file,
+ StabilityReport* report);
virtual bool WriteReportToMinidump(StabilityReport* report,
const crashpad::UUID& client_id,

Powered by Google App Engine
This is Rietveld 408576698