• Lukasz Anforowicz's avatar
    [reland] Make ExternalFileURLLoaderFactory owned by its |receivers_|. · eb016c59
    Lukasz Anforowicz authored
    This CL introduces ExternalFileURLLoaderFactory::Create static method
    that allows creating a ExternalFileURLLoaderFactory 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<ExternalFileURLLoaderFactory>, because this ability
    means that the factory can be destructed while receivers bound via the
    Clone method are still alive (see the associated bug).  In particular,
    this CL stops exposing ExternalFileURLLoaderFactory constructor as a
    public member, which forces construction to go via the new Create static
    method.
    
    This CL mostly just follows the pattern established earlier by
    https://crrev.com/c/2337411.
    
    Bug: 1106995
    Change-Id: Iadb47d1f73c73f08a8d0cd2a9c303ddef7158bad
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443398
    Commit-Queue: Sam McNally <sammc@chromium.org>
    Auto-Submit: Łukasz Anforowicz <lukasza@chromium.org>
    Reviewed-by: default avatarSam McNally <sammc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#813474}
    eb016c59
chrome_content_browser_client.cc 228 KB