diff options
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 5 | ||||
-rw-r--r-- | chrome_frame/crash_reporting/crash_metrics.cc | 9 | ||||
-rw-r--r-- | chrome_frame/crash_reporting/crash_metrics.h | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 7e5aa6c..b670548 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -1220,6 +1220,11 @@ void ChromeFrameAutomationClient::OnMessageReceivedUIThread( void ChromeFrameAutomationClient::OnChannelErrorUIThread() { DCHECK_EQ(PlatformThread::CurrentId(), ui_thread_id_); + + // Report a metric that something went wrong unexpectedly. + CrashMetricsReporter::GetInstance()->IncrementMetric( + CrashMetricsReporter::CHANNEL_ERROR_COUNT); + // Forward to the delegate. if (chrome_frame_delegate_) chrome_frame_delegate_->OnChannelError(); diff --git a/chrome_frame/crash_reporting/crash_metrics.cc b/chrome_frame/crash_reporting/crash_metrics.cc index e5d8fb5..2759e5d 100644 --- a/chrome_frame/crash_reporting/crash_metrics.cc +++ b/chrome_frame/crash_reporting/crash_metrics.cc @@ -19,6 +19,7 @@ wchar_t* CrashMetricsReporter::g_metric_names[LAST_METRIC] = { L"crashcount", L"chrome_frame_navigationcount", L"sessionid", + L"channel_error", }; CrashMetricsReporter* CrashMetricsReporter::GetInstance() { @@ -88,5 +89,11 @@ void CrashMetricsReporter::RecordCrashMetrics() { crash_count); SetMetric(CRASH_COUNT, 0); } -} + int channel_error_count = GetMetric(CHANNEL_ERROR_COUNT); + if (channel_error_count > 0) { + THREAD_SAFE_UMA_HISTOGRAM_COUNTS("ChromeFrame.ChannelErrorCount", + channel_error_count); + SetMetric(CHANNEL_ERROR_COUNT, 0); + } +} diff --git a/chrome_frame/crash_reporting/crash_metrics.h b/chrome_frame/crash_reporting/crash_metrics.h index a51ca7d..96a6761 100644 --- a/chrome_frame/crash_reporting/crash_metrics.h +++ b/chrome_frame/crash_reporting/crash_metrics.h @@ -22,6 +22,7 @@ class CrashMetricsReporter { CRASH_COUNT, CHROME_FRAME_NAVIGATION_COUNT, SESSION_ID, + CHANNEL_ERROR_COUNT, LAST_METRIC, }; // Returns the global instance of this class. @@ -62,4 +63,3 @@ class CrashMetricsReporter { }; #endif // CHROME_FRAME_CRASH_REPORTING_CRASH_METRICS_H_ - |