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

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

Issue 2472163003: [CustomTabs] Report the navigation start as absolute time (Closed)
Patch Set: Cache tick offset Created 4 years, 1 month 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/metrics/PageLoadMetrics.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
index 87e6e798268e94501682de66cb78509c76ad8174..b7bd23022d05451344cdfe14126c10cf1826c403 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/PageLoadMetrics.java
@@ -17,6 +17,7 @@ import org.chromium.content_public.browser.WebContents;
*/
public class PageLoadMetrics {
public static final String FIRST_CONTENTFUL_PAINT = "firstContentfulPaint";
+ public static final String NAVIGATION_START = "navigationStart";
/** Observer for page load metrics. */
public interface Observer {
@@ -24,9 +25,11 @@ public class PageLoadMetrics {
* Called when the first contentful paint page load metric is available.
*
* @param webContents the WebContents this metrics is related to.
+ * @param navigationStartTick Absolute navigation start time, as TimeTicks.
* @param firstContentfulPaintMs Time to first contentful paint from navigation start.
*/
- public void onFirstContentfulPaint(WebContents webContents, long firstContentfulPaintMs);
+ public void onFirstContentfulPaint(
+ WebContents webContents, long navigationStartTick, long firstContentfulPaintMs);
}
private static ObserverList<Observer> sObservers;
@@ -46,11 +49,13 @@ public class PageLoadMetrics {
}
@CalledByNative
- static void onFirstContentfulPaint(WebContents webContents, long firstContentfulPaintMs) {
+ static void onFirstContentfulPaint(
+ WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
ThreadUtils.assertOnUiThread();
if (sObservers == null) return;
for (Observer observer : sObservers) {
- observer.onFirstContentfulPaint(webContents, firstContentfulPaintMs);
+ observer.onFirstContentfulPaint(
+ webContents, navigationStartTick, firstContentfulPaintMs);
}
}

Powered by Google App Engine
This is Rietveld 408576698