From e10466b4c4b464d010e6d80648e5206f13cc9e3b Mon Sep 17 00:00:00 2001 From: Ashwin Naren Date: Wed, 16 Jul 2025 21:15:23 -0700 Subject: [PATCH] net: Do not print SVG tree in `Debug` implementation of `VectorImageData` (#37846) Manually implement Debug LoadResult so that VectorImageData doesn't get logged. Testing: N/A Fixes: #37771 Signed-off-by: Ashwin Naren --- components/net/image_cache.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/net/image_cache.rs b/components/net/image_cache.rs index 8df2b277afc..003854467c9 100644 --- a/components/net/image_cache.rs +++ b/components/net/image_cache.rs @@ -267,13 +267,19 @@ impl CompletedLoad { } } -#[derive(Clone, Debug, MallocSizeOf)] +#[derive(Clone, MallocSizeOf)] struct VectorImageData { #[conditional_malloc_size_of] svg_tree: Arc, cors_status: CorsStatus, } +impl std::fmt::Debug for VectorImageData { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("VectorImageData").finish() + } +} + enum DecodedImage { Raster(RasterImage), Vector(VectorImageData),