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

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

Issue 23443009: [Android] Support startup histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Android] Support startup histogram - fix missing copyright notice 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
« no previous file with comments | « no previous file | chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellApplication.java » ('j') | 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/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
new file mode 100644
index 0000000000000000000000000000000000000000..deb568ae5cfc44657157139db258fdffd929ec8e
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/UmaUtils.java
@@ -0,0 +1,33 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser;
+
+import org.chromium.base.CalledByNative;
+
+/**
+ * Utilities to support startup metrics - Android version.
+ */
+public class UmaUtils {
+
+ private static long sApplicationStartWallClockMs;
+
+ /**
+ * 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.
+ sApplicationStartWallClockMs = System.currentTimeMillis();
+ }
+
+ @CalledByNative
+ private static long getMainEntryPointTime() {
+ return sApplicationStartWallClockMs;
+ }
+
+}
« no previous file with comments | « no previous file | chrome/android/testshell/java/src/org/chromium/chrome/testshell/ChromiumTestShellApplication.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698