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

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

Issue 818513002: Android: UMA histogram for coldstart-to-commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 11 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/android/java/src/org/chromium/chrome/browser/UmaUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/UmaUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/UmaUtils.java
index deb568ae5cfc44657157139db258fdffd929ec8e..ff2e9d5c4fe5955b3709824c26a6a667705a356e 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/UmaUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/UmaUtils.java
@@ -13,6 +13,8 @@ public class UmaUtils {
private static long sApplicationStartWallClockMs;
+ private static boolean sRunningApplicationStart;
+
/**
* Record the time at which the activity started. This should be called asap after
* the start of the activity's onCreate function.
@@ -25,6 +27,25 @@ public class UmaUtils {
sApplicationStartWallClockMs = System.currentTimeMillis();
}
+ /**
+ * Whether the application is in the early stage since the browser process start. The
+ * "application start" ends right after the last histogram related to browser startup is
+ * recorded. Currently, the very first navigation commit in the lifetime of the process ends the
+ * "application start".
+ * Must only be called on the UI thread.
+ */
+ public static boolean isRunningApplicationStart() {
+ return sRunningApplicationStart;
+ }
+
+ /**
+ * Marks/unmarks the "application start" stage of the browser process lifetime.
+ * Must only be called on the UI thread.
+ */
+ public static void setRunningApplicationStart(boolean isAppStart) {
+ sRunningApplicationStart = isAppStart;
+ }
+
@CalledByNative
private static long getMainEntryPointTime() {
return sApplicationStartWallClockMs;

Powered by Google App Engine
This is Rietveld 408576698