• Jialiu Lin's avatar
    Resolve crash caused by enterprise whitelist checking · 0de6756c
    Jialiu Lin authored
    In the previous implementation, a raw ProfileIOData* is passed around to
    facilitate enterprise whitelist checking. However, it is possible (e.g.
    during browser shutdown) the UrlCheckerDelegate outlives ProfileIOData,
    thus causes crash when calling this raw pointer.
    
    To fix this lifespan issue, we remove the ProfileIOData raw pointer that
    is indirectly passed to URLCheckerDelegateImpl, and move all the
    enterprise whitelist checking logic to earlier stage where we're sure
    the ProfileIOData pointer is valid.
    
    This CL doesn't change the existing behavior of enterprise whitelist
    checking, therefore SafeBrowsingBlockingPageBrowserTest::
    VerifyEnterpriseWhitelist still passes after this change with or without
    enabling kNetworkService feature.
    
    Bug: 818559
    Change-Id: Idba3c03f90dad3a78e033c43016179b8cc6e5515
    Reviewed-on: https://chromium-review.googlesource.com/969642
    Commit-Queue: Jialiu Lin <jialiul@chromium.org>
    Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
    Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#544922}
    0de6756c
safe_browsing_resource_throttle.h 1.93 KB