From d9879f1dc467a031829d5a769f572b99b5c37463 Mon Sep 17 00:00:00 2001 From: lizeb Date: Wed, 26 Aug 2015 05:25:30 -0700 Subject: [PATCH] customtabs: Make sure that the browser process is initialized in mayLaunchUrl(). Since the documentation doesn't force clients to call warmup() before mayLaunchUrl(), call warmup() for them inside mayLaunchUrl() if necessary. BUG=525002 Review URL: https://codereview.chromium.org/1311423003 Cr-Commit-Position: refs/heads/master@{#345590} --- .../chrome/browser/customtabs/CustomTabsConnection.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java index b5c90862d2bc6..2412a26740c7f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabsConnection.java @@ -319,6 +319,9 @@ public boolean mayLaunchUrl(ICustomTabsCallback callback, Uri url, final Bundle if (scheme != null && !scheme.equals("http") && !scheme.equals("https")) return false; if (!isCallerForegroundOrSelf()) return false; + // Things below need the browser process to be initialized. + if (!warmup(0)) return false; + final IBinder session = callback.asBinder(); final String urlString = url.toString(); final boolean noPrerendering =