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

Unified Diff: components/browser_watcher/postmortem_report_collector.h

Issue 2715903003: Bound the impact of system instability on chrome instability. (Closed)
Patch Set: Address Siggi's comments Created 3 years, 9 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..11ea2ea5b4bf64f53697cccf09a076f6bf4ef626 100644
--- a/components/browser_watcher/postmortem_report_collector.h
+++ b/components/browser_watcher/postmortem_report_collector.h
@@ -22,6 +22,7 @@
#include "base/macros.h"
#include "base/strings/string16.h"
#include "components/browser_watcher/stability_report.pb.h"
+#include "components/browser_watcher/system_session_analyzer_win.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
namespace browser_watcher {
@@ -46,8 +47,9 @@ class PostmortemReportCollector {
PostmortemReportCollector(const std::string& product_name,
const std::string& version_number,
- const std::string& channel_name);
- virtual ~PostmortemReportCollector() = default;
+ const std::string& channel_name,
+ SystemSessionAnalyzer* analyzer);
+ virtual ~PostmortemReportCollector();
// Collects postmortem stability reports from files found in |debug_info_dir|,
// relying on |debug_file_pattern| and |excluded_debug_files|. Reports are
@@ -55,7 +57,7 @@ class PostmortemReportCollector {
// Returns the number crash reports successfully registered with the reporter.
// TODO(manzagop): consider mechanisms for partial collection if this is to be
// used on a critical path.
- int CollectAndSubmitForUpload(
+ int CollectAndSubmitAllPendingReports(
const base::FilePath& debug_info_dir,
const base::FilePath::StringType& debug_file_pattern,
const std::set<base::FilePath>& excluded_debug_files,
@@ -84,6 +86,9 @@ class PostmortemReportCollector {
FRIEND_TEST_ALL_PREFIXES(
PostmortemReportCollectorCollectionFromGlobalTrackerTest,
ModuleCollection);
+ FRIEND_TEST_ALL_PREFIXES(
+ PostmortemReportCollectorCollectionFromGlobalTrackerTest,
+ SystemStateTest);
// Virtual for unittesting.
virtual std::vector<base::FilePath> GetDebugStateFilePaths(
@@ -91,15 +96,18 @@ class PostmortemReportCollector {
const base::FilePath::StringType& debug_file_pattern,
const std::set<base::FilePath>& excluded_debug_files);
- CollectionStatus CollectAndSubmit(
+ CollectionStatus CollectAndSubmitOneReport(
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);
+ virtual CollectionStatus CollectOneReport(
+ const base::FilePath& debug_state_file,
+ std::unique_ptr<StabilityReport>* report);
+ void SetReporterDetails(StabilityReport* report) const;
+ void RecordSystemShutdownState(StabilityReport* report) const;
void CollectThread(
const base::debug::ThreadActivityAnalyzer::Snapshot& snapshot,
ThreadState* thread_state);
@@ -113,6 +121,8 @@ class PostmortemReportCollector {
std::string version_number_;
std::string channel_name_;
+ SystemSessionAnalyzer* system_session_analyzer_; // Not owned.
+
DISALLOW_COPY_AND_ASSIGN(PostmortemReportCollector);
};

Powered by Google App Engine
This is Rietveld 408576698