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

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

Issue 2847533004: customtabs: Don't cache the Tab in PageLoadMetricsObserver. (Closed)
Patch Set: Created 3 years, 8 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 | no next file » | 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/customtabs/CustomTabActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
index 1157436e4a182369894bf90b8952448673b7d6a9..377845462440b593e3d7e6d1f82a7c8076ac93d6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java
@@ -131,19 +131,19 @@ public class CustomTabActivity extends ChromeActivity {
private static class PageLoadMetricsObserver implements PageLoadMetrics.Observer {
private final CustomTabsConnection mConnection;
private final CustomTabsSessionToken mSession;
- private final Tab mTab;
+ private final WebContents mWebContents;
public PageLoadMetricsObserver(CustomTabsConnection connection,
CustomTabsSessionToken session, Tab tab) {
mConnection = connection;
mSession = session;
- mTab = tab;
+ mWebContents = tab.getWebContents();
}
@Override
public void onFirstContentfulPaint(
WebContents webContents, long navigationStartTick, long firstContentfulPaintMs) {
- if (webContents != mTab.getWebContents()) return;
+ if (webContents != mWebContents) return;
mConnection.notifyPageLoadMetric(mSession, PageLoadMetrics.FIRST_CONTENTFUL_PAINT,
navigationStartTick, firstContentfulPaintMs);
@@ -152,7 +152,7 @@ public class CustomTabActivity extends ChromeActivity {
@Override
public void onLoadEventStart(
WebContents webContents, long navigationStartTick, long loadEventStartMs) {
- if (webContents != mTab.getWebContents()) return;
+ if (webContents != mWebContents) return;
mConnection.notifyPageLoadMetric(mSession, PageLoadMetrics.LOAD_EVENT_START,
navigationStartTick, loadEventStartMs);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698