Bug 1783240 - Part 1: Remove unnecessary Log methods from ParamTraits impls, r=ipc-reviewers,necko-reviewers,media-playback-reviewers,mccr8,alwu

These aren't used anywhere, so can be removed, simplifying some things.

Differential Revision: https://phabricator.services.mozilla.com/D153802
This commit is contained in:
Nika Layzell 2022-09-28 19:25:12 +00:00
parent 9e85242679
commit f6ee20b0fd
14 changed files with 0 additions and 226 deletions

View file

@ -102,13 +102,6 @@ struct ParamTraits<ChromePackage> {
} }
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"[%s, %s, %s, %s, %u]", aParam.package.get(),
aParam.contentBaseURI.spec.get(),
aParam.localeBaseURI.spec.get(),
aParam.skinBaseURI.spec.get(), aParam.flags));
}
}; };
template <> template <>
@ -137,12 +130,6 @@ struct ParamTraits<SubstitutionMapping> {
} }
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"[%s://%s, %s, %u]", aParam.scheme.get(),
aParam.path.get(),
aParam.resolvedURI.spec.get()));
}
}; };
template <> template <>
@ -165,11 +152,6 @@ struct ParamTraits<OverrideMapping> {
} }
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"[%s, %s, %u]", aParam.originalURI.spec.get(),
aParam.overrideURI.spec.get()));
}
}; };
} // namespace IPC } // namespace IPC

View file

@ -35,10 +35,6 @@ struct ParamTraits<mozilla::dom::indexedDB::Key> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return ReadParam(aReader, &aResult->mBuffer); return ReadParam(aReader, &aResult->mBuffer);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.mBuffer, aLog);
}
}; };
template <> template <>
@ -61,10 +57,6 @@ struct ParamTraits<mozilla::dom::indexedDB::KeyPath> {
return ReadParam(aReader, &aResult->mType) && return ReadParam(aReader, &aResult->mType) &&
ReadParam(aReader, &aResult->mStrings); ReadParam(aReader, &aResult->mStrings);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.mStrings, aLog);
}
}; };
template <> template <>

View file

@ -55,13 +55,6 @@ struct ParamTraits<mozilla::dom::LSValue> {
ReadParam(aReader, &aResult->mConversionType) && ReadParam(aReader, &aResult->mConversionType) &&
ReadParam(aReader, &aResult->mCompressionType); ReadParam(aReader, &aResult->mCompressionType);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.mBuffer, aLog);
LogParam(aParam.mUTF16Length, aLog);
LogParam(static_cast<uint8_t>(aParam.mConversionType), aLog);
LogParam(static_cast<uint8_t>(aParam.mCompressionType), aLog);
}
}; };
} // namespace IPC } // namespace IPC

View file

@ -87,13 +87,6 @@ struct ParamTraits<GMPSimulcastStream> {
} }
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"[%u, %u, %u, %u, %u, %u, %u]", aParam.mWidth,
aParam.mHeight, aParam.mNumberOfTemporalLayers,
aParam.mMaxBitrate, aParam.mTargetBitrate,
aParam.mMinBitrate, aParam.mQPMax));
}
}; };
template <> template <>
@ -174,15 +167,6 @@ struct ParamTraits<GMPVideoCodec> {
return true; return true;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
const char* codecName = nullptr;
if (aParam.mCodecType == kGMPVideoCodecVP8) {
codecName = "VP8";
}
aLog->append(StringPrintf(L"[%s, %u, %u]", codecName, aParam.mWidth,
aParam.mHeight));
}
}; };
} // namespace IPC } // namespace IPC

View file

@ -69,12 +69,6 @@ struct ParamTraits<mozilla::gfx::Matrix> {
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"[[%g %g] [%g %g] [%g %g]]", aParam._11,
aParam._12, aParam._21, aParam._22, aParam._31,
aParam._32));
}
}; };
template <> template <>

View file

@ -282,9 +282,6 @@ class Message : public mojo::core::ports::UserMessage, public Pickle {
header()->event_footer_size = size; header()->event_footer_size = size;
} }
// Used for async messages with no parameters.
static void Log(const Message* msg, std::wstring* l) {}
static int HeaderSize() { return sizeof(Header); } static int HeaderSize() { return sizeof(Header); }
// Figure out how big the message starting at range_start is. Returns 0 if // Figure out how big the message starting at range_start is. Returns 0 if

View file

@ -298,11 +298,6 @@ static inline bool WARN_UNUSED_RESULT ReadParam(MessageReader* reader, P* p) {
return ParamTraits<P>::Read(reader, p); return ParamTraits<P>::Read(reader, p);
} }
template <typename P>
static inline void LogParam(const P& p, std::wstring* l) {
ParamTraits<P>::Log(p, l);
}
// Temporary fallback class to allow types to declare serialization using the // Temporary fallback class to allow types to declare serialization using the
// IPDLParamTraits type class. Will be removed once all remaining // IPDLParamTraits type class. Will be removed once all remaining
// IPDLParamTraits implementations are gone. (bug 1754009) // IPDLParamTraits implementations are gone. (bug 1754009)
@ -341,9 +336,6 @@ struct ParamTraitsFundamental<bool> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBool(r); return reader->ReadBool(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(p ? L"true" : L"false");
}
}; };
template <> template <>
@ -355,9 +347,6 @@ struct ParamTraitsFundamental<int> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt(r); return reader->ReadInt(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%d", p));
}
}; };
template <> template <>
@ -369,9 +358,6 @@ struct ParamTraitsFundamental<long> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadLong(r); return reader->ReadLong(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%l", p));
}
}; };
template <> template <>
@ -383,9 +369,6 @@ struct ParamTraitsFundamental<unsigned long> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadULong(r); return reader->ReadULong(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ul", p));
}
}; };
template <> template <>
@ -397,9 +380,6 @@ struct ParamTraitsFundamental<long long> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBytesInto(r, sizeof(*r)); return reader->ReadBytesInto(r, sizeof(*r));
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ll", p));
}
}; };
template <> template <>
@ -411,9 +391,6 @@ struct ParamTraitsFundamental<unsigned long long> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBytesInto(r, sizeof(*r)); return reader->ReadBytesInto(r, sizeof(*r));
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ull", p));
}
}; };
template <> template <>
@ -425,9 +402,6 @@ struct ParamTraitsFundamental<double> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadDouble(r); return reader->ReadDouble(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"e", p));
}
}; };
// Fixed-size <stdint.h> types. // Fixed-size <stdint.h> types.
@ -444,9 +418,6 @@ struct ParamTraitsFixed<int16_t> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt16(r); return reader->ReadInt16(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%hd", p));
}
}; };
template <> template <>
@ -458,9 +429,6 @@ struct ParamTraitsFixed<uint16_t> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadUInt16(r); return reader->ReadUInt16(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%hu", p));
}
}; };
template <> template <>
@ -472,9 +440,6 @@ struct ParamTraitsFixed<uint32_t> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadUInt32(r); return reader->ReadUInt32(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%u", p));
}
}; };
template <> template <>
@ -486,9 +451,6 @@ struct ParamTraitsFixed<int64_t> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt64(r); return reader->ReadInt64(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%" PRId64L, p));
}
}; };
template <> template <>
@ -500,9 +462,6 @@ struct ParamTraitsFixed<uint64_t> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt64(reinterpret_cast<int64_t*>(r)); return reader->ReadInt64(reinterpret_cast<int64_t*>(r));
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%" PRIu64L, p));
}
}; };
// std::* types. // std::* types.
@ -519,9 +478,6 @@ struct ParamTraitsStd<std::string> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadString(r); return reader->ReadString(r);
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(UTF8ToWide(p));
}
}; };
template <> template <>
@ -533,7 +489,6 @@ struct ParamTraitsStd<std::wstring> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadWString(r); return reader->ReadWString(r);
} }
static void Log(const param_type& p, std::wstring* l) { l->append(p); }
}; };
template <class K, class V> template <class K, class V>
@ -558,9 +513,6 @@ struct ParamTraitsStd<std::map<K, V>> {
} }
return true; return true;
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(L"<std::map>");
}
}; };
// Windows-specific types. // Windows-specific types.
@ -579,9 +531,6 @@ struct ParamTraitsWindows<HANDLE> {
static bool Read(MessageReader* reader, HANDLE* r) { static bool Read(MessageReader* reader, HANDLE* r) {
return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r)); return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r));
} }
static void Log(const HANDLE& p, std::wstring* l) {
l->append(StringPrintf(L"0x%X", p));
}
}; };
template <> template <>
@ -594,9 +543,6 @@ struct ParamTraitsWindows<HWND> {
static bool Read(MessageReader* reader, HWND* r) { static bool Read(MessageReader* reader, HWND* r) {
return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r)); return reader->ReadIntPtr(reinterpret_cast<intptr_t*>(r));
} }
static void Log(const HWND& p, std::wstring* l) {
l->append(StringPrintf(L"0x%X", p));
}
}; };
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
@ -707,9 +653,6 @@ struct ParamTraitsMozilla<nsresult> {
static bool Read(MessageReader* reader, param_type* r) { static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadUInt32(reinterpret_cast<uint32_t*>(r)); return reader->ReadUInt32(reinterpret_cast<uint32_t*>(r));
} }
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%u", static_cast<uint32_t>(p)));
}
}; };
// See comments for the IPDLParamTraits specializations for RefPtr<T> and // See comments for the IPDLParamTraits specializations for RefPtr<T> and

View file

@ -52,10 +52,6 @@ struct ParamTraits<mozilla::ipc::ByteBuf> {
} }
return aReader->ReadBytesInto(aResult->mData, length); return aReader->ReadBytesInto(aResult->mData, length);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(L"(byte buf)");
}
}; };
} // namespace IPC } // namespace IPC

View file

@ -105,11 +105,6 @@ struct ParamTraits<int8_t> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return aReader->ReadBytesInto(aResult, sizeof(*aResult)); return aReader->ReadBytesInto(aResult, sizeof(*aResult));
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
// Use 0xff to avoid sign extension.
aLog->append(StringPrintf(L"0x%02x", aParam & 0xff));
}
}; };
template <> template <>
@ -123,10 +118,6 @@ struct ParamTraits<uint8_t> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return aReader->ReadBytesInto(aResult, sizeof(*aResult)); return aReader->ReadBytesInto(aResult, sizeof(*aResult));
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"0x%02x", aParam));
}
}; };
#if !defined(OS_POSIX) #if !defined(OS_POSIX)

View file

@ -111,13 +111,6 @@ struct ParamTraits<nsACString> {
return aReader->ReadBytesInto(aResult->BeginWriting(), length); return aReader->ReadBytesInto(aResult->BeginWriting(), length);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
if (aParam.IsVoid())
aLog->append(L"(NULL)");
else
aLog->append(UTF8ToWide(aParam.BeginReading()));
}
}; };
template <> template <>
@ -162,21 +155,6 @@ struct ParamTraits<nsAString> {
return aReader->ReadBytesInto(aResult->BeginWriting(), byteLength.value()); return aReader->ReadBytesInto(aResult->BeginWriting(), byteLength.value());
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
if (aParam.IsVoid())
aLog->append(L"(NULL)");
else {
#ifdef WCHAR_T_IS_UTF16
aLog->append(reinterpret_cast<const wchar_t*>(aParam.BeginReading()));
#else
uint32_t length = aParam.Length();
for (uint32_t index = 0; index < length; index++) {
aLog->push_back(std::wstring::value_type(aParam[index]));
}
#endif
}
}
}; };
template <> template <>
@ -332,15 +310,6 @@ struct ParamTraits<nsTArray<E>> {
} }
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
for (uint32_t index = 0; index < aParam.Length(); index++) {
if (index) {
aLog->append(L" ");
}
LogParam(aParam[index], aLog);
}
}
private: private:
// Length has already been written. Const overload. // Length has already been written. Const overload.
static void WriteValues(MessageWriter* aWriter, const paramType& aParam) { static void WriteValues(MessageWriter* aWriter, const paramType& aParam) {
@ -381,10 +350,6 @@ struct ParamTraits<FallibleTArray<E>> {
*aResult = std::move(temp); *aResult = std::move(temp);
return true; return true;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(static_cast<const nsTArray<E>&>(aParam), aLog);
}
}; };
template <typename E, size_t N> template <typename E, size_t N>
@ -468,15 +433,6 @@ struct ParamTraits<mozilla::Vector<E, N, AP>> {
return true; return true;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
for (uint32_t index = 0, len = aParam.length(); index < len; ++index) {
if (index) {
aLog->append(L" ");
}
LogParam(aParam[index], aLog);
}
}
}; };
template <typename E> template <typename E>
@ -542,15 +498,6 @@ struct ParamTraits<std::vector<E>> {
return true; return true;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
for (uint32_t index = 0, len = aParam.size(); index < len; ++index) {
if (index) {
aLog->append(L" ");
}
LogParam(aParam[index], aLog);
}
}
}; };
template <typename K, typename V> template <typename K, typename V>
@ -595,10 +542,6 @@ struct ParamTraits<float> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return aReader->ReadBytesInto(aResult, sizeof(*aResult)); return aReader->ReadBytesInto(aResult, sizeof(*aResult));
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"%g", aParam));
}
}; };
template <> template <>
@ -630,15 +573,6 @@ struct ParamTraits<nsID> {
return true; return true;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(L"{");
aLog->append(
StringPrintf(L"%8.8X-%4.4X-%4.4X-", aParam.m0, aParam.m1, aParam.m2));
for (unsigned int i = 0; i < mozilla::ArrayLength(aParam.m3); i++)
aLog->append(StringPrintf(L"%2.2X", aParam.m3[i]));
aLog->append(L"}");
}
}; };
template <> template <>
@ -701,10 +635,6 @@ struct ParamTraits<mozilla::dom::ipc::StructuredCloneData> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return aResult->ReadIPCParams(aReader); return aResult->ReadIPCParams(aReader);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.DataLength(), aLog);
}
}; };
template <class T> template <class T>

View file

@ -61,10 +61,6 @@ struct ParamTraits<mozilla::ipc::ActorHandle> {
} }
return false; return false;
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"(%d)", aParam.mId));
}
}; };
template <> template <>
@ -74,10 +70,6 @@ struct ParamTraits<mozilla::ipc::UntypedEndpoint> {
static void Write(MessageWriter* aWriter, paramType&& aParam); static void Write(MessageWriter* aWriter, paramType&& aParam);
static bool Read(MessageReader* aReader, paramType* aResult); static bool Read(MessageReader* aReader, paramType* aResult);
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(StringPrintf(L"Endpoint"));
}
}; };
template <class PFooSide> template <class PFooSide>

View file

@ -117,10 +117,6 @@ struct ParamTraits<mozilla::SerializedStructuredCloneBuffer> {
static bool Read(MessageReader* aReader, paramType* aResult) { static bool Read(MessageReader* aReader, paramType* aResult) {
return ReadParam(aReader, &aResult->data); return ReadParam(aReader, &aResult->data);
} }
static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.data.Size(), aLog);
}
}; };
} // namespace IPC } // namespace IPC

View file

@ -22,10 +22,6 @@ struct IPDLParamTraits<Shmem> {
paramType&& aParam); paramType&& aParam);
static bool Read(IPC::MessageReader* aReader, IProtocol* aActor, static bool Read(IPC::MessageReader* aReader, IProtocol* aActor,
paramType* aResult); paramType* aResult);
static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(L"(shmem segment)");
}
}; };
} // namespace ipc } // namespace ipc

View file

@ -62,18 +62,6 @@ struct ParamTraits<Permission> {
ReadParam(aReader, &aResult->expireType) && ReadParam(aReader, &aResult->expireType) &&
ReadParam(aReader, &aResult->expireTime); ReadParam(aReader, &aResult->expireTime);
} }
static void Log(const Permission& p, std::wstring* l) {
l->append(L"(");
LogParam(p.origin, l);
l->append(L", ");
LogParam(p.capability, l);
l->append(L", ");
LogParam(p.expireTime, l);
l->append(L", ");
LogParam(p.expireType, l);
l->append(L")");
}
}; };
template <> template <>