diff --git a/dom/media/doctor/DecoderDoctorLogger.h b/dom/media/doctor/DecoderDoctorLogger.h index 41307e57b87a..9b023c81fa90 100644 --- a/dom/media/doctor/DecoderDoctorLogger.h +++ b/dom/media/doctor/DecoderDoctorLogger.h @@ -98,56 +98,29 @@ public: Forward(aValue)); } - // LogValue with a string literal, as they are not seen as `const char*` by - // Variant. Also, a literal doesn't have runtime costs, so it's cheap to call - // directly. - template - static void LogValue(const char* aSubjectTypeName, - const void* aSubjectPointer, - DDLogCategory aCategory, - const char* aLabel, - const char (&aLiteral)[N]) - { - EagerLogValue(aSubjectTypeName, - aSubjectPointer, - aCategory, - aLabel, - static_cast(aLiteral)); - } - - template - static void LogValue(const Subject* aSubject, - DDLogCategory aCategory, - const char* aLabel, - const char (&aLiteral)[N]) - { - EagerLogValue( - aSubject, aCategory, aLabel, static_cast(aLiteral)); - } - - // Same as LogValue above, but needed to be seen by DDLOG... macros. - template + // EagerLogValue that can explicitly take strings, as the templated function + // above confuses Variant when forwarding string literals. static void EagerLogValue(const char* aSubjectTypeName, const void* aSubjectPointer, DDLogCategory aCategory, const char* aLabel, - const char (&aLiteral)[N]) + const char* aValue) { - EagerLogValue(aSubjectTypeName, - aSubjectPointer, - aCategory, - aLabel, - static_cast(aLiteral)); + Log(aSubjectTypeName, + aSubjectPointer, + aCategory, + aLabel, + DDLogValue{ aValue }); } - template + template static void EagerLogValue(const Subject* aSubject, DDLogCategory aCategory, const char* aLabel, - const char (&aLiteral)[N]) + const char* aValue) { EagerLogValue( - aSubject, aCategory, aLabel, static_cast(aLiteral)); + DDLoggedTypeTraits::Name(), aSubject, aCategory, aLabel, aValue); } template