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

Unified Diff: chrome/browser/ui/tabs/tab_discard_state.cc

Issue 1366203003: Fix tab discarding reload count metric. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_discard_state.cc
diff --git a/chrome/browser/ui/tabs/tab_discard_state.cc b/chrome/browser/ui/tabs/tab_discard_state.cc
index 7a7e8f05592e7e53ab1f097f6cbd95f17e81544c..22d24316eff0bbe8e664b50d3f0b4f683e8a5a06 100644
--- a/chrome/browser/ui/tabs/tab_discard_state.cc
+++ b/chrome/browser/ui/tabs/tab_discard_state.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/tabs/tab_discard_state.h"
+#include "base/metrics/histogram.h"
#include "content/public/browser/web_contents.h"
using content::WebContents;
@@ -43,6 +44,13 @@ bool TabDiscardState::IsDiscarded(WebContents* web_contents) {
// static
void TabDiscardState::SetDiscardState(WebContents* web_contents, bool state) {
TabDiscardState* discard_state = TabDiscardState::Get(web_contents);
chrisha 2015/09/25 17:11:52 Does this object only get called from a single thr
Georges Khalil 2015/09/25 18:36:25 Should all be on the UI thread. Added thread chec
+
+ if (discard_state->is_discarded_ && !state) {
+ static int reload_count = 0;
+ UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.Discard.ReloadCount", ++reload_count, 1,
+ 1000, 50);
+ }
+
discard_state->is_discarded_ = state;
}
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698