De-dup PrefixSet code in SafeBrowsingDatabaseManager.
[chromium-blink-merge.git] / components / browser_watcher / watcher_metrics_provider_win.h
blobd2a47545a5677375d5278de2897e6b97981de1a2
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
8 #include "base/macros.h"
9 #include "base/strings/string16.h"
10 #include "components/metrics/metrics_provider.h"
12 namespace browser_watcher {
14 // Provides stability data captured by the Chrome Watcher, namely the browser
15 // process exit codes, as well as exit funnel metrics.
16 // The exit funnel records a trace of named, timed events in registry per
17 // process. For reporting, the trace is recorded as a sequence of events
18 // named Stability.ExitFunnel.<eventname>, associated to the time
19 // (in milliseconds) from first event in a trace. For a normal process exit,
20 // the sequence might look like this:
21 // - Stability.ExitFunnel.Logoff: 0
22 // - Stability.ExitFunnel.NotifyShutdown: 10
23 // - Stability.ExitFunnel.EndSession: 20
24 // - Stability.ExitFunnel.KillProcess: 30
25 class WatcherMetricsProviderWin : public metrics::MetricsProvider {
26 public:
27 static const char kBrowserExitCodeHistogramName[];
28 static const char kExitFunnelHistogramPrefix[];
30 explicit WatcherMetricsProviderWin(const base::char16* registry_path);
31 ~WatcherMetricsProviderWin();
33 // metrics::MetricsProvider implementation.
34 virtual void ProvideStabilityMetrics(
35 metrics::SystemProfileProto* system_profile_proto) override;
37 private:
38 base::string16 registry_path_;
40 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin);
43 } // namespace browser_watcher
45 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_