Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[media_galleries] Fix crash and simplify MediaFileSystemRegistry
ExtensionGalleriesHost has a complicated lifetime. It was originally intended to be scoped to the lifetime of every tab that called a particular combination of Profile and extension_id. It used a bespoke system called RPHReferenceManager to manage this, but unfortunately, it likely broke due to either site-per-process or MPArch. I'm not sure what caused the breakage, but in any case, there's memory issues as documented in the bug. This CL tries redo it using PageUserData, and scope the lifetime to the lives of all the content::Page instances that refer to this combo of Profile and extension_id. It also changes it from ref-counted to a unique-pointer. This simplifies the lifetime semantics a bit further. Bug: 1343384 Change-Id: I293c3e6af5e38b8fe47cc8c1991dac17ef6fc3da Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3847078 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tommy Li <tommycli@chromium.org> Cr-Commit-Position: refs/heads/main@{#1038455}
- Loading branch information