Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: chrome/browser/ui/views/sad_tab_view.cc

Issue 2172013002: Wire up OOM exception to the sad tab page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@memory2
Patch Set: histograms Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/sad_tab_view.cc
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc
index 7b3c647a4f0e03dec312d001e01fff57e8d1cf23..60799d92dc96aa73293215dbaf2c1ae46ab2635a 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -112,6 +112,13 @@ SadTabView::SadTabView(WebContents* web_contents, chrome::SadTabKind kind)
<< web_contents->GetURL().GetOrigin().spec();
break;
}
+ case chrome::SAD_TAB_KIND_OOM: {
+ static int crashed_due_to_oom = 0;
+ crashed_due_to_oom++;
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
Alexei Svitkine (slow) 2016/07/25 20:39:00 This is UMA_HISTOGRAM_COUNTS_1000().
Will Harris 2016/07/25 20:47:53 Done.
+ "Tabs.SadTab.OomCreated", crashed_due_to_oom, 1, 1000, 50);
+ break;
+ }
#if defined(OS_CHROMEOS)
case chrome::SAD_TAB_KIND_KILLED_BY_OOM: {
RecordKillCreated();
@@ -166,6 +173,8 @@ SadTabView::SadTabView(WebContents* web_contents, chrome::SadTabKind kind)
if (kind_ == chrome::SAD_TAB_KIND_KILLED_BY_OOM)
message_id = IDS_KILLED_TAB_BY_OOM_MESSAGE;
#endif
+ if (kind_ == chrome::SAD_TAB_KIND_OOM)
+ message_id = IDS_SAD_TAB_OOM_MESSAGE;
message_ = CreateLabel(l10n_util::GetStringUTF16(message_id));
@@ -252,6 +261,12 @@ void SadTabView::OnPaint(gfx::Canvas* canvas) {
"Tabs.SadTab.CrashDisplayed", ++crashed, 1, 1000, 50);
break;
}
+ case chrome::SAD_TAB_KIND_OOM: {
+ static int crashed_due_to_oom = 0;
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "Tabs.SadTab.OomDisplayed", ++crashed_due_to_oom, 1, 1000, 50);
+ break;
+ }
case chrome::SAD_TAB_KIND_KILLED:
RecordKillDisplayed();
break;

Powered by Google App Engine
This is Rietveld 408576698