Chromium Code Reviews| 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; |
| } |