[WebLayer] Guard against crash due to race condition in translation
In https://chromium-review.googlesource.com/c/chromium/src/+/2297817, dougarnett@ added a guard against the Java translate infobar disappearing in between translation being initiated and it completing. This CL was done in response to Chrome crashes observed in the wild. While the root cause is not completely known, the hypothesis is that it is due to InfoBarContainer.java invoking InfoBarContainerAndroid::SetWebContents(null) in response to changes in Tab state. That invocation can result in a state where the Java infobar is gone but the native infobar is still present. Hence, if that change in Tab state occurs while translation is happening, when translation finishes the native infobar would receive a callback but without the Java infobar actually being present. This flow also occurs in WebLayer, when the Tab loses being active. Hence this CL preemptively ports the //chrome fix to //weblayer. Bug: 1093320 Change-Id: Ic967c3fbf2b668b8884841a4cee8c435de49ab7c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302757Reviewed-by:Clark DuVall <cduvall@chromium.org> Commit-Queue: Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#789507}
Showing
Please register or sign in to comment