Report memory usage for image frames. (#36581)

These changes make the image-cache memory reporter report much larger
values after loading image-heavy pages.

Testing: Manual testing on https://www.nist.gov/image-gallery
Fixes: #36559

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-04-17 07:57:04 -04:00 committed by GitHub
parent d345844ed7
commit 594c04dc7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -688,6 +688,12 @@ impl<T> MallocSizeOf for ipc_channel::ipc::IpcSender<T> {
}
}
impl MallocSizeOf for ipc_channel::ipc::IpcSharedMemory {
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
self.len()
}
}
impl<T: MallocSizeOf> MallocSizeOf for accountable_refcell::RefCell<T> {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
self.borrow().size_of(ops)

View file

@ -123,7 +123,6 @@ pub struct Image {
pub width: u32,
pub height: u32,
pub format: PixelFormat,
#[ignore_malloc_size_of = "Defined in webrender_api"]
pub id: Option<ImageKey>,
pub cors_status: CorsStatus,
pub frames: Vec<ImageFrame>,
@ -132,7 +131,6 @@ pub struct Image {
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
pub struct ImageFrame {
pub delay: Option<Duration>,
#[ignore_malloc_size_of = "Defined in ipc-channel"]
pub bytes: IpcSharedMemory,
pub width: u32,
pub height: u32,