Make ExternalFileURLLoaderFactory always owned by its |receivers_|.
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: I4bd235cf9132668d80657aece34de6fe7b60f78b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2357620Reviewed-by:Sam McNally <sammc@chromium.org> Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/master@{#812139}
Showing
Please register or sign in to comment