Skip to content

Commit

Permalink
[media_galleries] Fix crash and simplify MediaFileSystemRegistry
Browse files Browse the repository at this point in the history
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
Tommy C. Li authored and Chromium LUCI CQ committed Aug 23, 2022
1 parent 806638c commit 9e66dca
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 221 deletions.

0 comments on commit 9e66dca

Please sign in to comment.