diff --git a/image/decoders/nsPNGDecoder.cpp b/image/decoders/nsPNGDecoder.cpp index 6b60a9b914ab..41ff96c377b9 100644 --- a/image/decoders/nsPNGDecoder.cpp +++ b/image/decoders/nsPNGDecoder.cpp @@ -24,25 +24,8 @@ using namespace mozilla::gfx; namespace mozilla { namespace image { -static PRLogModuleInfo* -GetPNGLog() -{ - static PRLogModuleInfo* sPNGLog; - if (!sPNGLog) { - sPNGLog = PR_NewLogModule("PNGDecoder"); - } - return sPNGLog; -} - -static PRLogModuleInfo* -GetPNGDecoderAccountingLog() -{ - static PRLogModuleInfo* sPNGDecoderAccountingLog; - if (!sPNGDecoderAccountingLog) { - sPNGDecoderAccountingLog = PR_NewLogModule("PNGDecoderAccounting"); - } - return sPNGDecoderAccountingLog; -} +static LazyLogModule sPNGLog("PNGDecoder"); +static LazyLogModule sPNGDecoderAccountingLog("PNGDecoderAccounting"); // Limit image dimensions (bug #251381, #591822, and #967656) #ifndef MOZ_PNG_MAX_DIMENSION @@ -190,7 +173,7 @@ nsPNGDecoder::CreateFrame(png_uint_32 aXOffset, png_uint_32 aYOffset, mFrameRect = frameRect; - MOZ_LOG(GetPNGDecoderAccountingLog(), LogLevel::Debug, + MOZ_LOG(sPNGDecoderAccountingLog, LogLevel::Debug, ("PNGDecoderAccounting: nsPNGDecoder::CreateFrame -- created " "image frame with %dx%d pixels for decoder %p", aWidth, aHeight, this)); @@ -913,7 +896,7 @@ nsPNGDecoder::end_callback(png_structp png_ptr, png_infop info_ptr) void nsPNGDecoder::error_callback(png_structp png_ptr, png_const_charp error_msg) { - MOZ_LOG(GetPNGLog(), LogLevel::Error, ("libpng error: %s\n", error_msg)); + MOZ_LOG(sPNGLog, LogLevel::Error, ("libpng error: %s\n", error_msg)); png_longjmp(png_ptr, 1); } @@ -921,7 +904,7 @@ nsPNGDecoder::error_callback(png_structp png_ptr, png_const_charp error_msg) void nsPNGDecoder::warning_callback(png_structp png_ptr, png_const_charp warning_msg) { - MOZ_LOG(GetPNGLog(), LogLevel::Warning, ("libpng warning: %s\n", warning_msg)); + MOZ_LOG(sPNGLog, LogLevel::Warning, ("libpng warning: %s\n", warning_msg)); } Telemetry::ID