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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java

Issue 2759423002: Fix tab state UMAs on Android (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java
index ab7b35181b8bc7b8058e679ecb1473d17f1456d4..653d42a0f2f04350b7b2c9f8d62c3d1b470c05bc 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabUma.java
@@ -94,10 +94,10 @@ public class TabUma {
mTabCreationState = creationState;
mLastTabStateChangeMillis = System.currentTimeMillis();
- if (mTabCreationState == TabCreationState.LIVE_IN_FOREGROUND
- || mTabCreationState == TabCreationState.FROZEN_ON_RESTORE) {
+ if (mTabCreationState == TabCreationState.LIVE_IN_FOREGROUND) {
updateTabState(TAB_STATE_ACTIVE);
} else if (mTabCreationState == TabCreationState.LIVE_IN_BACKGROUND
+ || mTabCreationState == TabCreationState.FROZEN_ON_RESTORE
|| mTabCreationState == TabCreationState.FROZEN_FOR_LAZY_LOAD) {
updateTabState(TAB_STATE_INACTIVE);
} else if (mTabCreationState == TabCreationState.FROZEN_ON_RESTORE_FAILED) {
@@ -196,6 +196,9 @@ public class TabUma {
* @param newState New state of the tab.
*/
void updateTabState(int newState) {
+ if (mLastTabState == newState) {
+ return;
+ }
long now = System.currentTimeMillis();
recordTabStateTransition(mLastTabState, newState, now - mLastTabStateChangeMillis);
mLastTabStateChangeMillis = now;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698