Use kDefaultURL throughout SpdySessionTest.
[chromium-blink-merge.git] / components / browser_watcher / crash_reporting_metrics_win.h
blob6a63414b619b3c18cf6a2dba19a239dd70a805c3
1 // Copyright 2015 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_CRASH_REPORTING_METRICS_WIN_H_
6 #define COMPONENTS_BROWSER_WATCHER_CRASH_REPORTING_METRICS_WIN_H_
8 #include "base/strings/string16.h"
10 namespace browser_watcher {
12 // Stores and retrieves metrics related to crash dump attempts.
13 class CrashReportingMetrics {
14 public:
15 // Represents the currently stored metrics.
16 struct Values {
17 // A count of crash dump attempts.
18 int crash_dump_attempts;
19 // A count of successful crash dump attempts.
20 int successful_crash_dumps;
21 // A count of failed crash dump attempts.
22 int failed_crash_dumps;
23 // A count of dump without crash attempts.
24 int dump_without_crash_attempts;
25 // A count of successful dump without crash attempts.
26 int successful_dumps_without_crash;
27 // A count of failed dump without crash attempts.
28 int failed_dumps_without_crash;
31 // Instantiates an instance that will store and retrieve its metrics from
32 // |registry_path|.
33 explicit CrashReportingMetrics(const base::string16& registry_path);
35 // Records that a crash dump is being attempted.
36 void RecordCrashDumpAttempt();
38 // Records that a dump without crash is being attempted.
39 void RecordDumpWithoutCrashAttempt();
41 // Records the result of a crash dump attempt.
42 void RecordCrashDumpAttemptResult(bool succeeded);
44 // Records the result of a dump without crash attempt.
45 void RecordDumpWithoutCrashAttemptResult(bool succeeded);
47 // Returns the currently stored metrics and resets them to 0.
48 Values RetrieveAndResetMetrics();
50 private:
51 base::string16 registry_path_;
54 } // namespace browser_watcher
56 #endif // COMPONENTS_BROWSER_WATCHER_CRASH_REPORTING_METRICS_WIN_H_