• Maksim Ivanov's avatar
    Fix DCHECK in TestBackgroundPageFirstLoadObserver · 515b9ac4
    Maksim Ivanov authored
    Fix the problem with the DCHECK in
    TestBackgroundPageFirstLoadObserver::OnBackgroundHostCreated() being hit
    in case when the extension's background page host gets destroyed and
    recreated.
    
    The DCHECK was fired because the class didn't expect to observe more
    than one host at the same time. The underlying issue was that the class
    didn't stop observing the deleted host, leading to the DCHECK hit and a
    potential use-after-free (in tests).
    
    Bug: 1090941
    Test: stress-test the "CertificateProviderApiTest.LazyBackgroundPage" browser test after applying crrev.com/c/2312817
    Change-Id: I91cf8f3bb0126a04b63e3a73d3f39259c621f330
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312799Reviewed-by: default avatarIstiaque Ahmed <lazyboy@chromium.org>
    Commit-Queue: Maksim Ivanov <emaxx@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#791054}
    515b9ac4
test_background_page_first_load_observer.h 1.97 KB