• Douglas Creager's avatar
    Reporting: Clearly separate IO and UI thread concerns · 81cad473
    Douglas Creager authored
    This patch separates ReportingPermissionsChecker class in two, making it
    clearer which parts belong on the UI and IO threads.  The Profile
    creates an instance of the UI class on the UI thread, and then creates a
    subsidiary IO instance, which is how ChromeNetworkDelegate actually
    performs permissions checks.  The IO instance as a WeakPtr to the UI
    instance, since it must delegate to the IO thread to actually perform
    the check.  If the Profile starts tearing down itself (and by extension,
    the UI instance), the WeakPtr will be invalidated.  But importantly, the
    IO instance will still be well-formed, in case the network delegate is
    trying any outstanding permissions checks.
    
    Bug: 704259
    Change-Id: I2b8d437c835a00a90d59aa7e3f39a49d83f511f2
    Reviewed-on: https://chromium-review.googlesource.com/1059455
    Commit-Queue: Douglas Creager <dcreager@chromium.org>
    Reviewed-by: default avatarMatt Menke <mmenke@chromium.org>
    Reviewed-by: default avatarWez <wez@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#559526}
    81cad473
chrome_network_delegate_unittest.cc 26.9 KB