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

Unified Diff: chrome/android/java/src/org/chromium/chrome/common/StartupMetricUtils.java

Issue 23443009: [Android] Support startup histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Android] Support startup histogram; remove unnecessary change to AwShellApplication.java Created 7 years, 4 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/common/StartupMetricUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/common/StartupMetricUtils.java b/chrome/android/java/src/org/chromium/chrome/common/StartupMetricUtils.java
new file mode 100644
index 0000000000000000000000000000000000000000..095669e8b4f051c2a4308dda2dc3ce3b4610c97a
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/common/StartupMetricUtils.java
@@ -0,0 +1,29 @@
+package org.chromium.chrome.common;
+
+import org.chromium.base.CalledByNative;
+
+/**
+ * Utilities to support startup metrics - Android version.
+ */
+public class StartupMetricUtils {
+
+ static long applicationStartWallclockMs_;
jeremy 2013/08/27 19:18:51 nit: WallClock (?)
Yaron 2013/08/27 20:42:30 Make private and should be named sApplicationStart
aberent 2013/08/28 15:53:05 Done.
aberent 2013/08/28 15:53:05 Done.
+
+ /**
+ * Record the time at which the activity started. This should be called asap after
+ * the start of the activity's onCreate function.
+ */
+ public static void recordMainEntryPointTime() {
+ // We can't simply pass this down through a JNI call, since the JNI for chrome
+ // isn't initialized until we start the native content browser component, and we
+ // then need the start time in the C++ side before we return to Java. As such we
+ // save it in a static that the C++ can fetch once it has initialized the JNI.
+ applicationStartWallclockMs_ = System.currentTimeMillis();
+ }
+
+ @CalledByNative
+ private static long getMainEntryPointTime() {
+ return applicationStartWallclockMs_;
+ }
+
+}

Powered by Google App Engine
This is Rietveld 408576698