Commit e095ed7f authored by Mohamed Heikal's avatar Mohamed Heikal Committed by Commit Bot

[Android] Fix crash if browser startup completes before activity

Currently a crash can occur if CustomTabsConnections starts the browser
synchronously while an async browser startup is in progress.

Bug: 881019
Change-Id: I2d1b764c8212a05b85f59c5edfa92ac28a4171f9
Reviewed-on: https://chromium-review.googlesource.com/1210623Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589204}
parent 426aa9fb
...@@ -40,10 +40,9 @@ public class ActivityTabStartupMetricsTracker { ...@@ -40,10 +40,9 @@ public class ActivityTabStartupMetricsTracker {
.addStartupCompletedObserver(new BrowserStartupController.StartupCallback() { .addStartupCompletedObserver(new BrowserStartupController.StartupCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
// Activity could have called finish and returned early during startup but // The activity's TabModelSelector may not have been initialized yet
// not have onDestroy called yet. The activity's TabModelSelector may not // causing a crash. See https://crbug.com/847580
// have been initialized causing a crash. See https://crbug.com/847580 if (!mActivity.areTabModelsInitialized()) return;
if (mActivity.isActivityFinishing()) return;
registerObservers(); registerObservers();
} }
......
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