• Alex Ilin's avatar
    [sheriff] Revert "weblayer: make it possible to delete tab in OnNavigationFailed..." · fe725c4d
    Alex Ilin authored
    This reverts commit 7d8ab070.
    
    Reason for revert: NavigationBrowserTest.DestroyTabInNavigation fails
    on Android P, https://crbug.com/1123021
    
    Original change's description:
    > weblayer: make it possible to delete tab in OnNavigationFailed...
    > 
    > and OnNavigationCompleted.
    > 
    > Content does not allow WebContents to be deleted from
    > WebContentsObserver::DidFinishNavigation(). Unfortunately we
    > keep seeing crashes because of this restriction, so I'm
    > inclined to provide some mitigation.
    > 
    > This patch takes the approach of detecting this scenario
    > and delaying deletion of the WebContents. All the surrounding
    > WebLayer classes are deleted/destroyed and ownership of the
    > WebContents is passed to the Profile and deleted from a
    > post-task.
    > 
    > Doing this may introduce it's own set of problems. For example,
    > if a callback/notification is still in flight from content that gets
    > processed before the deletion, and the code assumes there is a Tab
    > associated with the WebContents, then there will be problems.
    > 
    > My preference is still to fix this in content, but in the mean
    > time this should work.
    > 
    > BUG=1111127
    > TEST=covered by test
    > 
    > Change-Id: I9dbd9f90b88cbdbdfbab9aab81840b986fcdc410
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377552
    > Commit-Queue: Scott Violet <sky@chromium.org>
    > Reviewed-by: John Abd-El-Malek <jam@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#802416}
    
    TBR=sky@chromium.org,jam@chromium.org
    
    Change-Id: I3a52b345d649e48ae0d9b6a4e480cf602214d2c4
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 1111127, 1123021
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2380657Reviewed-by: default avatarAlex Ilin <alexilin@chromium.org>
    Commit-Queue: Alex Ilin <alexilin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#802649}
    fe725c4d
profile_impl.h 6.59 KB