| 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
|
|
|