summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-08 20:52:28 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-08 20:52:28 +0000
commitb835c68f6c1e4e0152ac7a061093aa4dcb62ab25 (patch)
tree59e89f2380886948f3eb60b5fdf96fee552239de /chrome_frame
parent61e12a2cfb1e6b42131a3084954a0b9c464ed397 (diff)
downloadchromium_src-b835c68f6c1e4e0152ac7a061093aa4dcb62ab25.zip
chromium_src-b835c68f6c1e4e0152ac7a061093aa4dcb62ab25.tar.gz
chromium_src-b835c68f6c1e4e0152ac7a061093aa4dcb62ab25.tar.bz2
Add a Chrome Frame metric to track channel errors that result in sad tabs.
BUG=65899 TEST=None Review URL: http://codereview.chromium.org/5665003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/chrome_frame_automation.cc5
-rw-r--r--chrome_frame/crash_reporting/crash_metrics.cc9
-rw-r--r--chrome_frame/crash_reporting/crash_metrics.h2
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_
-