Fix leaks of the SiteDataCacheFactory instance between tests
The BrowserContextKeyedServiceFactory are leaked between tests (by design) and this is problematic with the SiteDataCacheFacadeFactory because it owns an SiteDataCacheFactory object in a SequenceBound wrapper. Leaking this between tests causes UAFs on the task runner used by this SequenceBound wrapper. The solution consists in tracking the number of alive SiteDataCacheFacade instances and releasing the SiteDataCacheFactory when this count reaches 0. As profiles always get destroyed before terminating a test this ensures that we don't leak the SiteDataCacheFactory anymore. Bug: 1127928 Change-Id: I88777d8761f60aeeb90322234f861d196ed9e548 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422079 Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org> Reviewed-by:Chris Hamilton <chrisha@chromium.org> Cr-Commit-Position: refs/heads/master@{#810518}
Showing
Please register or sign in to comment