Android: Ensure single TabWebContentsObserver per Tab

TabWebContentsObserver is TabWebContentsUserData which is created
for the first active WebContents for a given Tab, and finally
destroyed together with the Tab. There was a bug creating
multiple instances of the observer for every new active WebContents.
This left an instance for old WebContents undestroyed, and caused
a reported bug for already nulled out WebContents references
while handling an event that should not have been triggered.

This CL makes sure there will be a single TabWebContentsObserver
for Tab.

Bug: 894353
Change-Id: Ie2cbe5c79b4d1e9f68d1be045c4d7e88d91c5312
Reviewed-on: https://chromium-review.googlesource.com/c/1278426
Reviewed-by: Ted Choc <tedchoc@chromium.org>
Commit-Queue: Jinsuk Kim <jinsukkim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599109}
1 file changed