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