• Lukasz Anforowicz's avatar
    Make (SpecialAccess)FileURLLoaderFactory always owned by its receivers_ · 44a0f9e1
    Lukasz Anforowicz authored
    This CL renames the FileURLLoaderFactory in an anonymous namespace in
    //chrome/browser/chrome_content_browser_client.cc to
    SpecialAccessFileURLLoaderFactory (to distinguish it from the
    content::FileURLLoaderFactory).
    
    This CL introduces SpecialAccessFileURLLoaderFactory::Create static
    method that allows creating a SpecialAccessFileURLLoaderFactory that is
    owned by its |receivers_| and will self-delete when the last receiver
    disconnects.
    
    This CL removes the ability to directly construct and own a
    std::unique_ptr<SpecialAccessFileURLLoaderFactory>, because this ability
    means that the factory can be destructed while receivers bound via the
    Clone method are still alive (see the associated bug).
    
    This CL mostly just follows the pattern established earlier by
    https://crrev.com/c/2337411.
    
    Bug: 1106995
    Change-Id: If5d9731ceee4d62144e12c18f67dda7df4379b0a
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358058Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#812071}
    44a0f9e1
chrome_content_browser_client.cc 229 KB