Make AboutURLLoaderFactory always owned by its |receivers_|.
This CL introduces AboutURLLoaderFactory::Create static method that allows creating an AboutURLLoaderFactory 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<AboutURLLoaderFactory>, 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 AboutURLLoaderFactory 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: Id93cc5b5078019d95dd19988ffdffb8e40d7ac31 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358053 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:
Alex Moshchuk <alexmos@chromium.org> Cr-Commit-Position: refs/heads/master@{#805584}
Showing
Please register or sign in to comment