• arthursonzogni's avatar
    Revert "Retire ScopedObserver in HungPagesTableModel". · b42ced69
    arthursonzogni authored
    Instead of trying to forward fix, dumbly revert the cause of crashes.
    Hopefully, just in time before M89 branch cut.
    
    This revert will fix:
    - https://crbug.com/1153966
    - https://crbug.com/1153961
    
    This revert part of:
    https://chromium-review.googlesource.com/c/chromium/src/+/2548022
    ```
    Retire ScopedObserver in /chrome/browser/ui/views.
    
    ScopedObserver is being deprecated in favor of two new classes:
    - base::ScopedObservation for observers that only ever observe
      a single source.
    - base::ScopedMultiSourceObservation for observers that do or may
      observe more than a single source.
    
    This CL was uploaded by git cl split.
    
    R=bsep@chromium.org
    
    Bug: 1145565
    ```
    
    There was an existing bug. Unexpectedly, HungPagesTableModel::
    InitForWebContents() can be called twice. See
    https://crbug.com/1165917. For some reasons, this didn't resulted in any
    crashes...
    
    ...until the reverted patch cames in.
    The old base::ScopedObserver was supporting multiple observations. The
    new one: base::ScopedObservation doesn't. As a result, if
    base::ScopedObservation::Observe is called twice, then RemoveObserver
    will be called only once instead of two, causing the issue.
    
    Bug: 1153966,1153961
    Change-Id: Iecc8e8e0e9fa387795ce55b4414d1d871cc4c9a0
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2625867Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
    Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#842940}
    b42ced69
hung_renderer_view.cc 16.5 KB