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

Unified Diff: components/browser_watcher/watcher_metrics_provider_win.h

Issue 2963573004: [Cleanup] Migrate the WatcherMetricsProvider to use the Task Scheduler. (Closed)
Patch Set: Document that registry interactions can block, and adjust the unittest not to be flaky Created 3 years, 5 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.h
diff --git a/components/browser_watcher/watcher_metrics_provider_win.h b/components/browser_watcher/watcher_metrics_provider_win.h
index 65c5307d3016284b98beaf99df0cb7a28803c14e..fbd408233c0b151f2928192f33e1ee47a58562f0 100644
--- a/components/browser_watcher/watcher_metrics_provider_win.h
+++ b/components/browser_watcher/watcher_metrics_provider_win.h
@@ -11,7 +11,6 @@
#include "base/memory/weak_ptr.h"
#include "base/strings/string16.h"
#include "base/task_runner.h"
-#include "base/threading/thread_checker.h"
#include "components/metrics/metrics_provider.h"
namespace browser_watcher {
@@ -26,14 +25,11 @@ class WatcherMetricsProviderWin : public metrics::MetricsProvider {
static const char kBrowserExitCodeHistogramName[];
- // Initializes the reporter. |io_task_runner| is used for collecting
- // postmortem reports and clearing leftover data in registry if metrics
- // reporting is disabled.
+ // Initializes the reporter.
WatcherMetricsProviderWin(const base::string16& registry_path,
const base::FilePath& user_data_dir,
const base::FilePath& crash_dir,
- const GetExecutableDetailsCallback& exe_details_cb,
- base::TaskRunner* io_task_runner);
+ const GetExecutableDetailsCallback& exe_details_cb);
~WatcherMetricsProviderWin() override;
// metrics::MetricsProvider implementation.
@@ -59,7 +55,7 @@ class WatcherMetricsProviderWin : public metrics::MetricsProvider {
private:
// TODO(manzagop): avoid collecting reports for clean exits from the fast exit
// path.
- void CollectPostmortemReportsOnBlockingPool();
+ void CollectPostmortemReportsImpl();
bool recording_enabled_;
bool cleanup_scheduled_;
@@ -67,7 +63,11 @@ class WatcherMetricsProviderWin : public metrics::MetricsProvider {
const base::FilePath user_data_dir_;
const base::FilePath crash_dir_;
GetExecutableDetailsCallback exe_details_cb_;
- scoped_refptr<base::TaskRunner> io_task_runner_;
+
+ // Used for collecting postmortem reports and clearing leftover data in
+ // registry if metrics reporting is disabled.
+ scoped_refptr<base::TaskRunner> task_runner_;
+
base::WeakPtrFactory<WatcherMetricsProviderWin> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin);
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.cc ('k') | components/browser_watcher/watcher_metrics_provider_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698