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

Unified Diff: components/browser_watcher/watcher_metrics_provider_win.cc

Issue 2372633002: Use the correct product/version for postmortem reports (Closed)
Patch Set: Direct access to GetExecutableVersionDetails via ChromePostmortemReportCollector Created 4 years, 3 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/watcher_metrics_provider_win.cc
diff --git a/components/browser_watcher/watcher_metrics_provider_win.cc b/components/browser_watcher/watcher_metrics_provider_win.cc
index c6ab669a03d5efef3a5a21f96630b127ea6ea490..1dca51111ca2fa9363545a8d56c00e00df8556c2 100644
--- a/components/browser_watcher/watcher_metrics_provider_win.cc
+++ b/components/browser_watcher/watcher_metrics_provider_win.cc
@@ -9,6 +9,7 @@
#include <limits>
#include <memory>
#include <set>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -23,7 +24,6 @@
#include "base/strings/utf_string_conversions.h"
#include "base/win/registry.h"
#include "components/browser_watcher/features.h"
-#include "components/browser_watcher/postmortem_report_collector.h"
#include "components/browser_watcher/stability_debugging_win.h"
#include "third_party/crashpad/crashpad/client/crash_report_database.h"
@@ -217,12 +217,14 @@ WatcherMetricsProviderWin::WatcherMetricsProviderWin(
const base::string16& registry_path,
const base::FilePath& user_data_dir,
const base::FilePath& crash_dir,
+ std::unique_ptr<PostmortemReportCollector> collector,
base::TaskRunner* io_task_runner)
: recording_enabled_(false),
cleanup_scheduled_(false),
registry_path_(registry_path),
user_data_dir_(user_data_dir),
crash_dir_(crash_dir),
+ collector_(std::move(collector)),
io_task_runner_(io_task_runner),
weak_ptr_factory_(this) {
DCHECK(io_task_runner_);
@@ -277,6 +279,7 @@ void WatcherMetricsProviderWin::CollectPostmortemReportsOnBlockingPool() {
// TODO(manzagop): delete possible leftover data.
return;
}
+ DCHECK_NE(nullptr, collector_.get());
SCOPED_UMA_HISTOGRAM_TIMER("ActivityTracker.Collect.TotalTime");
@@ -314,10 +317,9 @@ void WatcherMetricsProviderWin::CollectPostmortemReportsOnBlockingPool() {
LogCollectionInitStatus(INIT_SUCCESS);
// TODO(manzagop): fix incorrect version attribution on update.
- PostmortemReportCollector collector;
- collector.CollectAndSubmitForUpload(stability_dir, GetStabilityFilePattern(),
- excluded_debug_files,
- crashpad_database.get());
+ collector_->CollectAndSubmitForUpload(
+ stability_dir, GetStabilityFilePattern(), excluded_debug_files,
+ crashpad_database.get());
}
} // namespace browser_watcher

Powered by Google App Engine
This is Rietveld 408576698