Commit d716bfa8 authored by Peter E Conn's avatar Peter E Conn Committed by Commit Bot

Allow disabling StartupTabPreloader from the Intent.

The AGA experiment id changes in:
  https://chromium-review.googlesource.com/c/chromium/src/+/2338934
does not work when the StartupTabPreloader is used. Since the
StartupTabPreloader launches the navigation before all of native is
loaded, fixing this isn't simply a matter of moving the experiment
reading code earlier - it would involve changing Chrome's startup logic.

This change allows clients to disable the StartupTabPreloader to ensure
that the experiment logic in the linked CL is triggered (at the cost of
a longer time to navigation on cold start).

Change-Id: Ie83b4f38705084c567d7c20821600de7cdf15695
Bug: 1111941
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2356505
Commit-Queue: Peter Conn <peconn@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Auto-Submit: Peter Conn <peconn@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798203}
parent 54938d52
......@@ -42,6 +42,9 @@ import org.chromium.url.GURL;
* is created. This is done to improve startup latency.
*/
public class StartupTabPreloader implements ProfileManager.Observer, Destroyable {
private static final String EXTRA_DISABLE_STARTUP_TAB_PRELOADER =
"org.chromium.chrome.browser.init.DISABLE_STARTUP_TAB_PRELOADER";
private final Supplier<Intent> mIntentSupplier;
private final ActivityLifecycleDispatcher mActivityLifecycleDispatcher;
private final WindowAndroid mWindowAndroid;
......@@ -154,6 +157,9 @@ public class StartupTabPreloader implements ProfileManager.Observer, Destroyable
if (mTab != null) return false;
Intent intent = mIntentSupplier.get();
if (IntentUtils.safeGetBooleanExtra(intent, EXTRA_DISABLE_STARTUP_TAB_PRELOADER, false)) {
return false;
}
if (mIntentHandler.shouldIgnoreIntent(intent)) return false;
if (getUrlFromIntent(intent) == null) return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment