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