| OLD | NEW |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
| 6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/task_runner.h" | 10 #include "base/task_runner.h" |
| 11 #include "components/metrics/metrics_provider.h" | 11 #include "components/metrics/metrics_provider.h" |
| 12 | 12 |
| 13 namespace browser_watcher { | 13 namespace browser_watcher { |
| 14 | 14 |
| 15 // Provides stability data captured by the Chrome Watcher, namely the browser | 15 // Provides stability data captured by the Chrome Watcher, namely the browser |
| 16 // process exit codes. | 16 // process exit codes. |
| 17 class WatcherMetricsProviderWin : public metrics::MetricsProvider { | 17 class WatcherMetricsProviderWin : public metrics::MetricsProvider { |
| 18 public: | 18 public: |
| 19 static const char kBrowserExitCodeHistogramName[]; | 19 static const char kBrowserExitCodeHistogramName[]; |
| 20 | 20 |
| 21 // Initializes the reporter. |cleanup_io_task_runner| is used to clear | 21 // Initializes the reporter. |cleanup_io_task_runner| is used to clear |
| 22 // leftover data in registry if metrics reporting is disabled. | 22 // leftover data in registry if metrics reporting is disabled. |
| 23 WatcherMetricsProviderWin(const base::char16* registry_path, | 23 WatcherMetricsProviderWin(const base::string16& registry_path, |
| 24 base::TaskRunner* cleanup_io_task_runner); | 24 base::TaskRunner* cleanup_io_task_runner); |
| 25 ~WatcherMetricsProviderWin() override; | 25 ~WatcherMetricsProviderWin() override; |
| 26 | 26 |
| 27 // metrics::MetricsProvider implementation. | 27 // metrics::MetricsProvider implementation. |
| 28 void OnRecordingEnabled() override; | 28 void OnRecordingEnabled() override; |
| 29 void OnRecordingDisabled() override; | 29 void OnRecordingDisabled() override; |
| 30 void ProvideStabilityMetrics( | 30 void ProvideStabilityMetrics( |
| 31 metrics::SystemProfileProto* system_profile_proto) override; | 31 metrics::SystemProfileProto* system_profile_proto) override; |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 bool recording_enabled_; | 34 bool recording_enabled_; |
| 35 bool cleanup_scheduled_; | 35 bool cleanup_scheduled_; |
| 36 base::string16 registry_path_; | 36 const base::string16 registry_path_; |
| 37 scoped_refptr<base::TaskRunner> cleanup_io_task_runner_; | 37 scoped_refptr<base::TaskRunner> cleanup_io_task_runner_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin); | 39 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 } // namespace browser_watcher | 42 } // namespace browser_watcher |
| 43 | 43 |
| 44 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ | 44 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ |
| OLD | NEW |