Backed out changeset 1007c1b189cf (bug 1902621) for causing bc failures related to EnumValidator. CLOSED TREE

This commit is contained in:
Iulian Moraru 2024-08-08 14:39:14 +03:00
Родитель 22228d259d
Коммит 161fe69fb0
2 изменённых файлов: 45 добавлений и 14 удалений

Просмотреть файл

@ -61,7 +61,6 @@ interface nsITRRSkipReason: nsISupports
TRR_HEURISTIC_TRIPPED_PROXY = 46, // The heuristic was tripped due to a proxy being detected
TRR_HEURISTIC_TRIPPED_NRPT = 47, // The heuristic was tripped due to a NRPT being detected
TRR_BAD_URL = 48, // We attempted to use a bad URL (doesn't parse or is not https).
eLAST_VALUE = TRR_BAD_URL, // This entry should always hold the last and largest value in the enum
};
};

Просмотреть файл

@ -129,16 +129,37 @@ struct ParamTraits<mozilla::net::NetAddr> {
};
template <>
struct ParamTraits<nsIRequest::TRRMode>
: public ContiguousEnumSerializerInclusive<nsIRequest::TRRMode,
nsIRequest::TRR_DEFAULT_MODE,
nsIRequest::TRR_ONLY_MODE> {};
struct ParamTraits<nsIRequest::TRRMode> {
static void Write(MessageWriter* aWriter, const nsIRequest::TRRMode& aParam) {
WriteParam(aWriter, (uint8_t)aParam);
}
static bool Read(MessageReader* aReader, nsIRequest::TRRMode* aResult) {
uint8_t mode;
if (!ReadParam(aReader, &mode)) {
return false;
}
// TODO: sanity check
*aResult = static_cast<nsIRequest::TRRMode>(mode);
return true;
}
};
template <>
struct ParamTraits<nsITRRSkipReason::value>
: public ContiguousEnumSerializerInclusive<
nsITRRSkipReason::value, nsITRRSkipReason::value::TRR_UNSET,
nsITRRSkipReason::value::eLAST_VALUE> {};
struct ParamTraits<nsITRRSkipReason::value> {
static void Write(MessageWriter* aWriter,
const nsITRRSkipReason::value& aParam) {
WriteParam(aWriter, (uint8_t)aParam);
}
static bool Read(MessageReader* aReader, nsITRRSkipReason::value* aResult) {
uint8_t reason;
if (!ReadParam(aReader, &reason)) {
return false;
}
// TODO: sanity check
*aResult = static_cast<nsITRRSkipReason::value>(reason);
return true;
}
};
template <>
struct ParamTraits<nsIDNSService::DNSFlags>
@ -147,11 +168,22 @@ struct ParamTraits<nsIDNSService::DNSFlags>
};
template <>
struct ParamTraits<nsIDNSService::ResolverMode>
: public ContiguousEnumSerializerInclusive<
nsIDNSService::ResolverMode,
nsIDNSService::ResolverMode::MODE_NATIVEONLY,
nsIDNSService::ResolverMode::MODE_TRROFF> {};
struct ParamTraits<nsIDNSService::ResolverMode> {
static void Write(MessageWriter* aWriter,
const nsIDNSService::ResolverMode& aParam) {
WriteParam(aWriter, (uint8_t)aParam);
}
static bool Read(MessageReader* aReader,
nsIDNSService::ResolverMode* aResult) {
uint8_t mode;
if (!ReadParam(aReader, &mode)) {
return false;
}
// TODO: sanity check
*aResult = static_cast<nsIDNSService::ResolverMode>(mode);
return true;
}
};
} // namespace IPC