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

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

Issue 2422413003: customtabs: Add a histogram about the state if the renderer on creation. (Closed)
Patch Set: . Created 4 years, 2 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 | tools/metrics/histograms/histograms.xml » ('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/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 26afef05a009f0f6f22c70b89660459d387f5f2f..ab73b0dac1e93ddec513217c7e01497cf580f36d 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
@@ -77,6 +77,12 @@ public class CustomTabActivity extends ChromeActivity {
private static final String TAG = "CustomTabActivity";
private static final String LAST_URL_PREF = "pref_last_custom_tab_url";
+ // For CustomTabs.WebContentsStateOnLaunch, see histograms.xml. Append only.
+ private static final int WEBCONTENTS_STATE_NO_WEBCONTENTS = 0;
+ private static final int WEBCONTENTS_STATE_PRERENDERED_WEBCONTENTS = 1;
+ private static final int WEBCONTENTS_STATE_SPARE_WEBCONTENTS = 2;
+ private static final int WEBCONTENTS_STATE_MAX = 3;
+
private static CustomTabContentHandler sActiveContentHandler;
private FindToolbarManager mFindToolbarManager;
@@ -456,12 +462,17 @@ public class CustomTabActivity extends ChromeActivity {
tab.setAppAssociatedWith(customTabsConnection.getClientPackageNameForSession(mSession));
mPrerenderedUrl = customTabsConnection.getPrerenderedUrl(mSession);
+ int webContentsStateOnLaunch = WEBCONTENTS_STATE_NO_WEBCONTENTS;
WebContents webContents =
customTabsConnection.takePrerenderedUrl(mSession, url, referrerUrl);
mHasPrerendered = webContents != null;
+ if (mHasPrerendered) webContentsStateOnLaunch = WEBCONTENTS_STATE_PRERENDERED_WEBCONTENTS;
if (!mHasPrerendered) {
webContents = WarmupManager.getInstance().takeSpareWebContents(false, false);
+ if (webContents != null) webContentsStateOnLaunch = WEBCONTENTS_STATE_SPARE_WEBCONTENTS;
}
+ RecordHistogram.recordEnumeratedHistogram("CustomTabs.WebcontentsStateOnLaunch",
+ webContentsStateOnLaunch, WEBCONTENTS_STATE_MAX);
if (webContents == null) webContents = WebContentsFactory.createWebContents(false, false);
tab.initialize(
webContents, getTabContentManager(),
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698