Skip to content

Commit

Permalink
Bug 1783240 - Part 1: Remove unnecessary Log methods from ParamTrai…
Browse files Browse the repository at this point in the history
…ts 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
  • Loading branch information
mystor committed Sep 28, 2022
1 parent 04092c0 commit 835b952
Show file tree
Hide file tree
Showing 14 changed files with 0 additions and 226 deletions.
18 changes: 0 additions & 18 deletions chrome/RegistryMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,6 @@ struct ParamTraits<ChromePackage> {
}
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 <>
Expand Down Expand Up @@ -137,12 +130,6 @@ struct ParamTraits<SubstitutionMapping> {
}
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 <>
Expand All @@ -165,11 +152,6 @@ struct ParamTraits<OverrideMapping> {
}
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
Expand Down
8 changes: 0 additions & 8 deletions dom/indexedDB/SerializationHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ struct ParamTraits<mozilla::dom::indexedDB::Key> {
static bool Read(MessageReader* aReader, paramType* aResult) {
return ReadParam(aReader, &aResult->mBuffer);
}

static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.mBuffer, aLog);
}
};

template <>
Expand All @@ -61,10 +57,6 @@ struct ParamTraits<mozilla::dom::indexedDB::KeyPath> {
return ReadParam(aReader, &aResult->mType) &&
ReadParam(aReader, &aResult->mStrings);
}

static void Log(const paramType& aParam, std::wstring* aLog) {
LogParam(aParam.mStrings, aLog);
}
};

template <>
Expand Down
7 changes: 0 additions & 7 deletions dom/localstorage/SerializationHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,6 @@ struct ParamTraits<mozilla::dom::LSValue> {
ReadParam(aReader, &aResult->mConversionType) &&
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
Expand Down
16 changes: 0 additions & 16 deletions dom/media/gmp/GMPMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ struct ParamTraits<GMPSimulcastStream> {
}
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 <>
Expand Down Expand Up @@ -174,15 +167,6 @@ struct ParamTraits<GMPVideoCodec> {

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
Expand Down
6 changes: 0 additions & 6 deletions gfx/ipc/GfxMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ struct ParamTraits<mozilla::gfx::Matrix> {

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 <>
Expand Down
3 changes: 0 additions & 3 deletions ipc/chromium/src/chrome/common/ipc_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@ class Message : public mojo::core::ports::UserMessage, public Pickle {
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); }

// Figure out how big the message starting at range_start is. Returns 0 if
Expand Down
57 changes: 0 additions & 57 deletions ipc/chromium/src/chrome/common/ipc_message_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,6 @@ static inline bool WARN_UNUSED_RESULT ReadParam(MessageReader* reader, P* 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
// IPDLParamTraits type class. Will be removed once all remaining
// IPDLParamTraits implementations are gone. (bug 1754009)
Expand Down Expand Up @@ -341,9 +336,6 @@ struct ParamTraitsFundamental<bool> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBool(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(p ? L"true" : L"false");
}
};

template <>
Expand All @@ -355,9 +347,6 @@ struct ParamTraitsFundamental<int> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%d", p));
}
};

template <>
Expand All @@ -369,9 +358,6 @@ struct ParamTraitsFundamental<long> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadLong(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%l", p));
}
};

template <>
Expand All @@ -383,9 +369,6 @@ struct ParamTraitsFundamental<unsigned long> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadULong(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ul", p));
}
};

template <>
Expand All @@ -397,9 +380,6 @@ struct ParamTraitsFundamental<long long> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBytesInto(r, sizeof(*r));
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ll", p));
}
};

template <>
Expand All @@ -411,9 +391,6 @@ struct ParamTraitsFundamental<unsigned long long> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadBytesInto(r, sizeof(*r));
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%ull", p));
}
};

template <>
Expand All @@ -425,9 +402,6 @@ struct ParamTraitsFundamental<double> {
static bool Read(MessageReader* reader, param_type* 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.
Expand All @@ -444,9 +418,6 @@ struct ParamTraitsFixed<int16_t> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt16(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%hd", p));
}
};

template <>
Expand All @@ -458,9 +429,6 @@ struct ParamTraitsFixed<uint16_t> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadUInt16(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%hu", p));
}
};

template <>
Expand All @@ -472,9 +440,6 @@ struct ParamTraitsFixed<uint32_t> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadUInt32(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%u", p));
}
};

template <>
Expand All @@ -486,9 +451,6 @@ struct ParamTraitsFixed<int64_t> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadInt64(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(StringPrintf(L"%" PRId64L, p));
}
};

template <>
Expand All @@ -500,9 +462,6 @@ struct ParamTraitsFixed<uint64_t> {
static bool Read(MessageReader* reader, param_type* 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.
Expand All @@ -519,9 +478,6 @@ struct ParamTraitsStd<std::string> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadString(r);
}
static void Log(const param_type& p, std::wstring* l) {
l->append(UTF8ToWide(p));
}
};

template <>
Expand All @@ -533,7 +489,6 @@ struct ParamTraitsStd<std::wstring> {
static bool Read(MessageReader* reader, param_type* r) {
return reader->ReadWString(r);
}
static void Log(const param_type& p, std::wstring* l) { l->append(p); }
};

template <class K, class V>
Expand All @@ -558,9 +513,6 @@ struct ParamTraitsStd<std::map<K, V>> {
}
return true;
}
static void Log(const param_type& p, std::wstring* l) {
l->append(L"<std::map>");
}
};

// Windows-specific types.
Expand All @@ -579,9 +531,6 @@ struct ParamTraitsWindows<HANDLE> {
static bool Read(MessageReader* reader, HANDLE* 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 <>
Expand All @@ -594,9 +543,6 @@ struct ParamTraitsWindows<HWND> {
static bool Read(MessageReader* reader, HWND* 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)

Expand Down Expand Up @@ -707,9 +653,6 @@ struct ParamTraitsMozilla<nsresult> {
static bool Read(MessageReader* reader, param_type* 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
Expand Down
4 changes: 0 additions & 4 deletions ipc/glue/ByteBufUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ struct ParamTraits<mozilla::ipc::ByteBuf> {
}
return aReader->ReadBytesInto(aResult->mData, length);
}

static void Log(const paramType& aParam, std::wstring* aLog) {
aLog->append(L"(byte buf)");
}
};

} // namespace IPC
Expand Down
9 changes: 0 additions & 9 deletions ipc/glue/IPCMessageUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,6 @@ struct ParamTraits<int8_t> {
static bool Read(MessageReader* aReader, paramType* 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 <>
Expand All @@ -123,10 +118,6 @@ struct ParamTraits<uint8_t> {
static bool Read(MessageReader* aReader, paramType* 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)
Expand Down
Loading

0 comments on commit 835b952

Please sign in to comment.