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

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

Issue 2223883002: customtabs: Keep a reference to Tab in PageLoadMetricsObserver, not WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | 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 313fa875b0730fb2c249bde0162577031f40e06e..0976ef046fd2fad24733b7f61d839b21cbb62fc0 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
@@ -104,18 +104,18 @@ public class CustomTabActivity extends ChromeActivity {
private static class PageLoadMetricsObserver implements PageLoadMetrics.Observer {
private final CustomTabsConnection mConnection;
private final CustomTabsSessionToken mSession;
- private final WebContents mWebContents;
+ private final Tab mTab;
public PageLoadMetricsObserver(CustomTabsConnection connection,
- CustomTabsSessionToken session, WebContents webContents) {
+ CustomTabsSessionToken session, Tab tab) {
mConnection = connection;
mSession = session;
- mWebContents = webContents;
+ mTab = tab;
}
@Override
public void onFirstContentfulPaint(WebContents webContents, long firstContentfulPaintMs) {
- if (webContents != mWebContents) return;
+ if (webContents != mTab.getWebContents()) return;
mConnection.notifyPageLoadMetric(
mSession, PageLoadMetrics.FIRST_CONTENTFUL_PAINT, firstContentfulPaintMs);
@@ -432,7 +432,7 @@ public class CustomTabActivity extends ChromeActivity {
getApplication(), mSession, mIntentDataProvider.isOpenedByChrome());
mMetricsObserver = new PageLoadMetricsObserver(
- CustomTabsConnection.getInstance(getApplication()), mSession, webContents);
+ CustomTabsConnection.getInstance(getApplication()), mSession, tab);
tab.addObserver(mTabObserver);
return tab;
}
« 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