OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome_frame/crash_reporting/crash_metrics.h" | 5 #include "chrome_frame/crash_reporting/crash_metrics.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/win/registry.h" | 8 #include "base/win/registry.h" |
9 #include "chrome_frame/utils.h" | 9 #include "chrome_frame/utils.h" |
10 | 10 |
11 static const wchar_t kChromeFrameMetricsKey[] = | 11 static const wchar_t kChromeFrameMetricsKey[] = |
12 L"Software\\Google\\ChromeFrameMetrics"; | 12 L"Software\\Google\\ChromeFrameMetrics"; |
13 | 13 |
14 base::LazyInstance<CrashMetricsReporter> | 14 base::LazyInstance<CrashMetricsReporter> |
15 g_crash_metrics_instance_(base::LINKER_INITIALIZED); | 15 g_crash_metrics_instance_ = LAZY_INSTANCE_INITIALIZER; |
16 | 16 |
17 wchar_t* CrashMetricsReporter::g_metric_names[LAST_METRIC] = { | 17 wchar_t* CrashMetricsReporter::g_metric_names[LAST_METRIC] = { |
18 L"navigationcount", | 18 L"navigationcount", |
19 L"crashcount", | 19 L"crashcount", |
20 L"chrome_frame_navigationcount", | 20 L"chrome_frame_navigationcount", |
21 L"sessionid", | 21 L"sessionid", |
22 L"channel_error", | 22 L"channel_error", |
23 }; | 23 }; |
24 | 24 |
25 CrashMetricsReporter* CrashMetricsReporter::GetInstance() { | 25 CrashMetricsReporter* CrashMetricsReporter::GetInstance() { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 UMA_HISTOGRAM_COUNTS("ChromeFrame.HostCrashCount", crash_count); | 88 UMA_HISTOGRAM_COUNTS("ChromeFrame.HostCrashCount", crash_count); |
89 SetMetric(CRASH_COUNT, 0); | 89 SetMetric(CRASH_COUNT, 0); |
90 } | 90 } |
91 | 91 |
92 int channel_error_count = GetMetric(CHANNEL_ERROR_COUNT); | 92 int channel_error_count = GetMetric(CHANNEL_ERROR_COUNT); |
93 if (channel_error_count > 0) { | 93 if (channel_error_count > 0) { |
94 UMA_HISTOGRAM_COUNTS("ChromeFrame.ChannelErrorCount", channel_error_count); | 94 UMA_HISTOGRAM_COUNTS("ChromeFrame.ChannelErrorCount", channel_error_count); |
95 SetMetric(CHANNEL_ERROR_COUNT, 0); | 95 SetMetric(CHANNEL_ERROR_COUNT, 0); |
96 } | 96 } |
97 } | 97 } |
OLD | NEW |