зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1640839 - Stop generating a sentinel value at the end of WebIDL enums. r=mccr8,jgilbert,media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D201344
This commit is contained in:
Родитель
4fed5f1271
Коммит
62bdf442eb
|
@ -781,8 +781,6 @@ void Element::ScrollIntoView(const ScrollIntoViewOptions& aOptions) {
|
|||
return WhereToScroll::Center;
|
||||
case ScrollLogicalPosition::End:
|
||||
return WhereToScroll::End;
|
||||
case ScrollLogicalPosition::EndGuard_:
|
||||
MOZ_FALLTHROUGH_ASSERT("Unexpected block direction value");
|
||||
case ScrollLogicalPosition::Nearest:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1421,9 +1421,6 @@ inline Maybe<Enum> StringToEnum(const StringT& aString) {
|
|||
|
||||
template <typename Enum>
|
||||
inline const nsCString& GetEnumString(Enum stringId) {
|
||||
if (stringId == Enum::EndGuard_) {
|
||||
return EmptyCString();
|
||||
}
|
||||
MOZ_RELEASE_ASSERT(
|
||||
static_cast<size_t>(stringId) <
|
||||
mozilla::ArrayLength(binding_detail::EnumStrings<Enum>::Values));
|
||||
|
|
|
@ -12331,14 +12331,7 @@ def getEnumValueName(value):
|
|||
raise SyntaxError('"_empty" is not an IDL enum value we support yet')
|
||||
if value == "":
|
||||
return "_empty"
|
||||
nativeName = MakeNativeName(value)
|
||||
if nativeName == "EndGuard_":
|
||||
raise SyntaxError(
|
||||
'Enum value "' + value + '" cannot be used because it'
|
||||
" collides with our internal EndGuard_ value. Please"
|
||||
" rename our internal EndGuard_ to something else"
|
||||
)
|
||||
return nativeName
|
||||
return MakeNativeName(value)
|
||||
|
||||
|
||||
class CGEnumToJSValue(CGAbstractMethod):
|
||||
|
@ -12385,8 +12378,6 @@ class CGEnum(CGThing):
|
|||
static_assert(mozilla::ArrayLength(binding_detail::EnumStrings<${name}>::Values) == Count,
|
||||
"Mismatch between enum strings and enum count");
|
||||
|
||||
static_assert(static_cast<size_t>(${name}::EndGuard_) == Count,
|
||||
"Mismatch between enum value and enum count");
|
||||
""",
|
||||
count=self.nEnumStrings(),
|
||||
name=self.enum.identifier.name,
|
||||
|
@ -12452,7 +12443,6 @@ class CGEnum(CGThing):
|
|||
"""
|
||||
enum class ${name} : ${ty} {
|
||||
$*{enums}
|
||||
EndGuard_
|
||||
};
|
||||
""",
|
||||
name=self.enum.identifier.name,
|
||||
|
|
|
@ -67,8 +67,6 @@ inline constexpr bool IsEnumCase(const dom::WebGLPowerPreference raw) {
|
|||
case dom::WebGLPowerPreference::Low_power:
|
||||
case dom::WebGLPowerPreference::High_performance:
|
||||
return true;
|
||||
case dom::WebGLPowerPreference::EndGuard_:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -78,8 +76,6 @@ inline constexpr bool IsEnumCase(const dom::PredefinedColorSpace raw) {
|
|||
case dom::PredefinedColorSpace::Srgb:
|
||||
case dom::PredefinedColorSpace::Display_p3:
|
||||
return true;
|
||||
case dom::PredefinedColorSpace::EndGuard_:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -408,8 +408,6 @@ inline ColorSpace2 ToColorSpace2(const dom::PredefinedColorSpace cs) {
|
|||
return ColorSpace2::SRGB;
|
||||
case dom::PredefinedColorSpace::Display_p3:
|
||||
return ColorSpace2::DISPLAY_P3;
|
||||
case dom::PredefinedColorSpace::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_CRASH("Exhaustive switch");
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#include "FileSystemDirectoryHandle.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "FileSystemDirectoryIteratorFactory.h"
|
||||
#include "fs/FileSystemRequestHandler.h"
|
||||
#include "js/StructuredClone.h"
|
||||
|
@ -153,7 +155,7 @@ already_AddRefed<FileSystemDirectoryHandle>
|
|||
FileSystemDirectoryHandle::ReadStructuredClone(
|
||||
JSContext* aCx, nsIGlobalObject* aGlobal,
|
||||
JSStructuredCloneReader* aReader) {
|
||||
uint32_t kind = static_cast<uint32_t>(FileSystemHandleKind::EndGuard_);
|
||||
uint32_t kind = UINT32_MAX;
|
||||
|
||||
if (!JS_ReadBytes(aReader, reinterpret_cast<void*>(&kind),
|
||||
sizeof(uint32_t))) {
|
||||
|
|
|
@ -99,7 +99,7 @@ already_AddRefed<FileSystemFileHandle>
|
|||
FileSystemFileHandle::ReadStructuredClone(JSContext* aCx,
|
||||
nsIGlobalObject* aGlobal,
|
||||
JSStructuredCloneReader* aReader) {
|
||||
uint32_t kind = static_cast<uint32_t>(FileSystemHandleKind::EndGuard_);
|
||||
uint32_t kind = UINT32_MAX;
|
||||
|
||||
if (!JS_ReadBytes(aReader, reinterpret_cast<void*>(&kind),
|
||||
sizeof(uint32_t))) {
|
||||
|
|
|
@ -210,7 +210,7 @@ already_AddRefed<FileSystemHandle> FileSystemHandle::ReadStructuredClone(
|
|||
JSStructuredCloneReader* aReader) {
|
||||
LOG_VERBOSE(("Reading File/DirectoryHandle"));
|
||||
|
||||
uint32_t kind = static_cast<uint32_t>(FileSystemHandleKind::EndGuard_);
|
||||
uint32_t kind = UINT32_MAX;
|
||||
|
||||
if (!JS_ReadBytes(aReader, reinterpret_cast<void*>(&kind),
|
||||
sizeof(uint32_t))) {
|
||||
|
|
|
@ -315,8 +315,6 @@ RefPtr<MediaDeviceSetRefCnt> MediaDevices::FilterExposedDevices(
|
|||
}
|
||||
haveDefaultOutput = true;
|
||||
break;
|
||||
case MediaDeviceKind::EndGuard_:
|
||||
continue;
|
||||
// Avoid `default:` so that `-Wswitch` catches missing
|
||||
// enumerators at compile time.
|
||||
}
|
||||
|
@ -334,8 +332,6 @@ bool MediaDevices::CanExposeInfo(MediaDeviceKind aKind) const {
|
|||
case MediaDeviceKind::Audiooutput:
|
||||
// Assumes caller has used FilterExposedDevices()
|
||||
return true;
|
||||
case MediaDeviceKind::EndGuard_:
|
||||
break;
|
||||
// Avoid `default:` so that `-Wswitch` catches missing enumerators at
|
||||
// compile time.
|
||||
}
|
||||
|
|
|
@ -168,8 +168,12 @@ void ContentMediaControlKeyHandler::HandleMediaControlAction(
|
|||
if (!aContext->GetDocShell()) {
|
||||
return;
|
||||
}
|
||||
if (aAction.mKey.isNothing()) {
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid media control key.");
|
||||
return;
|
||||
}
|
||||
ContentPlaybackController controller(aContext);
|
||||
switch (aAction.mKey) {
|
||||
switch (aAction.mKey.value()) {
|
||||
case MediaControlKey::Focus:
|
||||
controller.Focus();
|
||||
return;
|
||||
|
@ -179,6 +183,9 @@ void ContentMediaControlKeyHandler::HandleMediaControlAction(
|
|||
case MediaControlKey::Pause:
|
||||
controller.Pause();
|
||||
return;
|
||||
case MediaControlKey::Playpause:
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid media control key.");
|
||||
return;
|
||||
case MediaControlKey::Stop:
|
||||
controller.Stop();
|
||||
return;
|
||||
|
|
|
@ -36,7 +36,11 @@ void MediaControlKeyHandler::OnActionPerformed(
|
|||
return;
|
||||
}
|
||||
|
||||
switch (aAction.mKey) {
|
||||
if (aAction.mKey.isNothing()) {
|
||||
MOZ_ASSERT_UNREACHABLE("Error : undefined media key!");
|
||||
return;
|
||||
}
|
||||
switch (aAction.mKey.value()) {
|
||||
case MediaControlKey::Focus:
|
||||
controller->Focus();
|
||||
return;
|
||||
|
|
|
@ -28,10 +28,10 @@ struct SeekDetails {
|
|||
|
||||
struct MediaControlAction {
|
||||
MediaControlAction() = default;
|
||||
explicit MediaControlAction(MediaControlKey aKey) : mKey(aKey) {}
|
||||
explicit MediaControlAction(MediaControlKey aKey) : mKey(Some(aKey)) {}
|
||||
MediaControlAction(MediaControlKey aKey, const SeekDetails& aDetails)
|
||||
: mKey(aKey), mDetails(Some(aDetails)) {}
|
||||
MediaControlKey mKey = MediaControlKey::EndGuard_;
|
||||
: mKey(Some(aKey)), mDetails(Some(aDetails)) {}
|
||||
Maybe<MediaControlKey> mKey;
|
||||
Maybe<SeekDetails> mDetails;
|
||||
};
|
||||
|
||||
|
|
|
@ -50,6 +50,14 @@ inline const char* ToMediaControlKeyStr(MediaControlKey aKey) {
|
|||
}
|
||||
}
|
||||
|
||||
inline const char* ToMediaControlKeyStr(const Maybe<MediaControlKey>& aKey) {
|
||||
if (aKey.isNothing()) {
|
||||
MOZ_ASSERT_UNREACHABLE("Invalid action.");
|
||||
return "Unknown";
|
||||
}
|
||||
return ToMediaControlKeyStr(aKey.value());
|
||||
}
|
||||
|
||||
inline const char* ToMediaSessionActionStr(MediaSessionAction aAction) {
|
||||
switch (aAction) {
|
||||
case MediaSessionAction::Play:
|
||||
|
@ -99,11 +107,6 @@ inline MediaControlKey ConvertMediaSessionActionToControlKey(
|
|||
}
|
||||
}
|
||||
|
||||
inline MediaSessionAction ConvertToMediaSessionAction(uint8_t aActionValue) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(aActionValue < uint8_t(MediaSessionAction::EndGuard_));
|
||||
return static_cast<MediaSessionAction>(aActionValue);
|
||||
}
|
||||
|
||||
inline const char* ToMediaPlaybackStateStr(MediaPlaybackState aState) {
|
||||
switch (aState) {
|
||||
case MediaPlaybackState::eStarted:
|
||||
|
|
|
@ -186,9 +186,10 @@ bool MediaController::ShouldPropagateActionToAllContexts(
|
|||
// These three actions have default action handler for each frame, so we
|
||||
// need to propagate to all contexts. We would handle default handlers in
|
||||
// `ContentMediaController::HandleMediaKey`.
|
||||
return aAction.mKey == MediaControlKey::Play ||
|
||||
aAction.mKey == MediaControlKey::Pause ||
|
||||
aAction.mKey == MediaControlKey::Stop;
|
||||
return aAction.mKey.isSome() &&
|
||||
(aAction.mKey.value() == MediaControlKey::Play ||
|
||||
aAction.mKey.value() == MediaControlKey::Pause ||
|
||||
aAction.mKey.value() == MediaControlKey::Stop);
|
||||
}
|
||||
|
||||
void MediaController::UpdateMediaControlActionToContentMediaIfNeeded(
|
||||
|
|
|
@ -18,7 +18,7 @@ class MediaKeyListenerTest : public MediaControlKeyListener {
|
|||
void Clear() { mReceivedKey = mozilla::Nothing(); }
|
||||
|
||||
void OnActionPerformed(const MediaControlAction& aAction) override {
|
||||
mReceivedKey = mozilla::Some(aAction.mKey);
|
||||
mReceivedKey = aAction.mKey;
|
||||
}
|
||||
bool IsResultEqualTo(MediaControlKey aResult) const {
|
||||
if (mReceivedKey) {
|
||||
|
|
|
@ -304,8 +304,7 @@ void MFCDMSession::OnSessionKeyMessage(
|
|||
case MF_MEDIAKEYSESSION_MESSAGETYPE_INDIVIDUALIZATION_REQUEST:
|
||||
return dom::MediaKeyMessageType::Individualization_request;
|
||||
default:
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown session message type");
|
||||
return dom::MediaKeyMessageType::EndGuard_;
|
||||
MOZ_CRASH("Unknown session message type");
|
||||
}
|
||||
};
|
||||
LOG("Notify 'keymessage' for %s", NS_ConvertUTF16toUTF8(*mSessionId).get());
|
||||
|
|
|
@ -329,10 +329,8 @@ class OscillatorNodeEngine final : public AudioNodeEngine {
|
|||
case OscillatorType::Custom:
|
||||
ComputeCustom(output, start, end, frequency, detune);
|
||||
break;
|
||||
case OscillatorType::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("end guard");
|
||||
// Avoid `default:` so that `-Wswitch` catches missing enumerators
|
||||
// at compile time.
|
||||
// Avoid `default:` so that `-Wswitch` catches missing enumerators at
|
||||
// compile time.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -385,8 +385,6 @@ static VideoColorSpaceInternal GuessColorSpace(
|
|||
// Make an educated guess based on the coefficients.
|
||||
colorSpace.mPrimaries = colorSpace.mMatrix.map([](const auto& aMatrix) {
|
||||
switch (aMatrix) {
|
||||
case VideoMatrixCoefficients::EndGuard_:
|
||||
MOZ_CRASH("This should not happen");
|
||||
case VideoMatrixCoefficients::Bt2020_ncl:
|
||||
return VideoColorPrimaries::Bt2020;
|
||||
case VideoMatrixCoefficients::Rgb:
|
||||
|
@ -523,9 +521,6 @@ static VideoColorSpaceInternal GuessColorSpace(layers::Image* aImage) {
|
|||
case VideoMatrixCoefficients::Bt2020_ncl:
|
||||
colorSpace.mPrimaries = Some(VideoColorPrimaries::Bt2020);
|
||||
break;
|
||||
case VideoMatrixCoefficients::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("bad enum value");
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -598,8 +598,6 @@ static bool IsYUVFormat(const VideoPixelFormat& aFormat) {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return false;
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -641,8 +639,6 @@ static VideoColorSpaceInit PickColorSpace(
|
|||
colorSpace.mPrimaries.SetValue(VideoColorPrimaries::Bt709);
|
||||
colorSpace.mTransfer.SetValue(VideoTransferCharacteristics::Iec61966_2_1);
|
||||
break;
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
}
|
||||
|
||||
return colorSpace;
|
||||
|
@ -881,8 +877,6 @@ static Result<RefPtr<layers::Image>, nsCString> CreateImageFromBuffer(
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return CreateRGBAImageFromBuffer(aFormat, aSize, aBuffer);
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
}
|
||||
return Err(nsCString("Invalid image format"));
|
||||
}
|
||||
|
@ -2031,8 +2025,6 @@ gfx::SurfaceFormat VideoFrame::Format::ToSurfaceFormat() const {
|
|||
case VideoPixelFormat::BGRX:
|
||||
format = gfx::SurfaceFormat::B8G8R8X8;
|
||||
break;
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
@ -2055,8 +2047,6 @@ void VideoFrame::Format::MakeOpaque() {
|
|||
case VideoPixelFormat::RGBX:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return;
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
}
|
||||
|
@ -2076,8 +2066,6 @@ nsTArray<VideoFrame::Format::Plane> VideoFrame::Format::Planes() const {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return {Plane::RGBA};
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
return {};
|
||||
|
@ -2124,8 +2112,6 @@ uint32_t VideoFrame::Format::SampleBytes(const Plane& aPlane) const {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return 4; // 8 bits/sample, 32 bits/pixel
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
return 0;
|
||||
|
@ -2153,7 +2139,6 @@ gfx::IntSize VideoFrame::Format::SampleSize(const Plane& aPlane) const {
|
|||
case VideoPixelFormat::RGBX:
|
||||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("invalid format");
|
||||
return {0, 0};
|
||||
}
|
||||
|
@ -2176,8 +2161,6 @@ bool VideoFrame::Format::IsValidSize(const gfx::IntSize& aSize) const {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return true;
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
return false;
|
||||
|
@ -2204,8 +2187,6 @@ size_t VideoFrame::Format::SampleCount(const gfx::IntSize& aSize) const {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return (count * 4).value();
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
break;
|
||||
}
|
||||
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported format");
|
||||
|
@ -2251,8 +2232,6 @@ uint32_t VideoFrame::Resource::Stride(const Format::Plane& aPlane) const {
|
|||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
return (width * mFormat->SampleBytes(aPlane)).value();
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("invalid format");
|
||||
}
|
||||
return 0;
|
||||
case Format::Plane::U: // and UV
|
||||
|
@ -2268,7 +2247,6 @@ uint32_t VideoFrame::Resource::Stride(const Format::Plane& aPlane) const {
|
|||
case VideoPixelFormat::RGBX:
|
||||
case VideoPixelFormat::BGRA:
|
||||
case VideoPixelFormat::BGRX:
|
||||
case VideoPixelFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("invalid format");
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -151,8 +151,6 @@ gfx::YUVColorSpace ToColorSpace(VideoMatrixCoefficients aMatrix) {
|
|||
return gfx::YUVColorSpace::BT601;
|
||||
case VideoMatrixCoefficients::Bt2020_ncl:
|
||||
return gfx::YUVColorSpace::BT2020;
|
||||
case VideoMatrixCoefficients::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported VideoMatrixCoefficients");
|
||||
return gfx::YUVColorSpace::Default;
|
||||
|
@ -171,8 +169,7 @@ gfx::TransferFunction ToTransferFunction(
|
|||
case VideoTransferCharacteristics::Hlg:
|
||||
return gfx::TransferFunction::HLG;
|
||||
case VideoTransferCharacteristics::Linear:
|
||||
case VideoTransferCharacteristics::EndGuard_:
|
||||
break;
|
||||
return gfx::TransferFunction::Default;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported VideoTransferCharacteristics");
|
||||
return gfx::TransferFunction::Default;
|
||||
|
@ -190,8 +187,6 @@ gfx::ColorSpace2 ToPrimaries(VideoColorPrimaries aPrimaries) {
|
|||
return gfx::ColorSpace2::BT2020;
|
||||
case VideoColorPrimaries::Smpte432:
|
||||
return gfx::ColorSpace2::DISPLAY_P3;
|
||||
case VideoColorPrimaries::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("unsupported VideoTransferCharacteristics");
|
||||
return gfx::ColorSpace2::UNKNOWN;
|
||||
|
|
|
@ -1671,7 +1671,6 @@ JsepSdpType ToJsepSdpType(dom::RTCSdpType aType) {
|
|||
return kJsepSdpAnswer;
|
||||
case dom::RTCSdpType::Rollback:
|
||||
return kJsepSdpRollback;
|
||||
case dom::RTCSdpType::EndGuard_:;
|
||||
}
|
||||
|
||||
MOZ_CRASH("Nonexistent dom::RTCSdpType");
|
||||
|
@ -3649,8 +3648,6 @@ RTCIceGatheringState PeerConnectionImpl::GetNewIceGatheringState() const {
|
|||
case RTCIceGathererState::Complete:
|
||||
foundComplete = true;
|
||||
break;
|
||||
case RTCIceGathererState::EndGuard_:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1502,7 +1502,6 @@ Maybe<RTCRtpSender::VideoConfig> RTCRtpSender::GetNewVideoConfig() {
|
|||
|
||||
case dom::MediaSourceEnum::Microphone:
|
||||
case dom::MediaSourceEnum::AudioCapture:
|
||||
case dom::MediaSourceEnum::EndGuard_:
|
||||
MOZ_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -239,7 +239,6 @@ SdpDirectionAttribute::Direction ToSdpDirection(
|
|||
case dom::RTCRtpTransceiverDirection::Inactive:
|
||||
case dom::RTCRtpTransceiverDirection::Stopped:
|
||||
return SdpDirectionAttribute::Direction::kInactive;
|
||||
case dom::RTCRtpTransceiverDirection::EndGuard_:;
|
||||
}
|
||||
MOZ_CRASH("Invalid transceiver direction!");
|
||||
}
|
||||
|
|
|
@ -1697,7 +1697,9 @@ void ReferrerInfo::RecordTelemetry(nsIHttpChannel* aChannel) {
|
|||
// requests and the rest 9 buckets are for cross-site requests.
|
||||
uint32_t telemetryOffset =
|
||||
IsCrossSiteRequest(aChannel)
|
||||
? static_cast<uint32_t>(ReferrerPolicy::EndGuard_)
|
||||
? UnderlyingValue(
|
||||
MaxContiguousEnumValue<dom::ReferrerPolicy>::value) +
|
||||
1
|
||||
: 0;
|
||||
|
||||
Telemetry::Accumulate(Telemetry::REFERRER_POLICY_COUNT,
|
||||
|
|
|
@ -165,8 +165,6 @@ void ServiceWorkerInfo::UpdateState(ServiceWorkerState aState) {
|
|||
// Any state can directly transition to redundant, but everything else is
|
||||
// ordered.
|
||||
if (aState != ServiceWorkerState::Redundant) {
|
||||
MOZ_ASSERT_IF(State() == ServiceWorkerState::EndGuard_,
|
||||
aState == ServiceWorkerState::Installing);
|
||||
MOZ_ASSERT_IF(State() == ServiceWorkerState::Installing,
|
||||
aState == ServiceWorkerState::Installed);
|
||||
MOZ_ASSERT_IF(State() == ServiceWorkerState::Installed,
|
||||
|
|
|
@ -128,9 +128,6 @@ static Maybe<ffi::WGPUFeatures> ToWGPUFeatures(
|
|||
|
||||
case dom::GPUFeatureName::Float32_filterable:
|
||||
return Some(WGPUFeatures_FLOAT32_FILTERABLE);
|
||||
|
||||
case dom::GPUFeatureName::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_CRASH("Bad GPUFeatureName.");
|
||||
}
|
||||
|
|
|
@ -321,8 +321,6 @@ already_AddRefed<BindGroupLayout> Device::CreateBindGroupLayout(
|
|||
case dom::GPUTextureSampleType::Depth:
|
||||
data.type = ffi::WGPURawTextureSampleType_Depth;
|
||||
break;
|
||||
case dom::GPUTextureSampleType::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE();
|
||||
}
|
||||
}
|
||||
if (entry.mStorageTexture.WasPassed()) {
|
||||
|
@ -350,8 +348,6 @@ already_AddRefed<BindGroupLayout> Device::CreateBindGroupLayout(
|
|||
case dom::GPUBufferBindingType::Read_only_storage:
|
||||
e.ty = ffi::WGPURawBindingType_ReadonlyStorageBuffer;
|
||||
break;
|
||||
case dom::GPUBufferBindingType::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE();
|
||||
}
|
||||
e.has_dynamic_offset = entry.mBuffer.Value().mHasDynamicOffset;
|
||||
}
|
||||
|
@ -393,8 +389,6 @@ already_AddRefed<BindGroupLayout> Device::CreateBindGroupLayout(
|
|||
case dom::GPUSamplerBindingType::Comparison:
|
||||
e.sampler_compare = true;
|
||||
break;
|
||||
case dom::GPUSamplerBindingType::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE();
|
||||
}
|
||||
}
|
||||
entries.AppendElement(e);
|
||||
|
|
|
@ -30,8 +30,6 @@ static ffi::WGPULoadOp ConvertLoadOp(const dom::GPULoadOp& aOp) {
|
|||
return ffi::WGPULoadOp_Load;
|
||||
case dom::GPULoadOp::Clear:
|
||||
return ffi::WGPULoadOp_Clear;
|
||||
case dom::GPULoadOp::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_CRASH("bad GPULoadOp");
|
||||
}
|
||||
|
@ -42,8 +40,6 @@ static ffi::WGPUStoreOp ConvertStoreOp(const dom::GPUStoreOp& aOp) {
|
|||
return ffi::WGPUStoreOp_Store;
|
||||
case dom::GPUStoreOp::Discard:
|
||||
return ffi::WGPUStoreOp_Discard;
|
||||
case dom::GPUStoreOp::EndGuard_:
|
||||
break;
|
||||
}
|
||||
MOZ_CRASH("bad GPUStoreOp");
|
||||
}
|
||||
|
|
|
@ -228,8 +228,6 @@ ffi::WGPUTextureFormat ConvertTextureFormat(
|
|||
case dom::GPUTextureFormat::Depth32float_stencil8:
|
||||
result.tag = ffi::WGPUTextureFormat_Depth32FloatStencil8;
|
||||
break;
|
||||
case dom::GPUTextureFormat::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE();
|
||||
}
|
||||
|
||||
// Clang will check for us that the switch above is exhaustive,
|
||||
|
|
|
@ -1452,8 +1452,6 @@ ipc::IPCResult WebGPUParent::RecvDevicePopErrorScope(
|
|||
case dom::GPUErrorFilter::Internal:
|
||||
ret.resultType = PopErrorScopeResultType::InternalError;
|
||||
break;
|
||||
case dom::GPUErrorFilter::EndGuard_:
|
||||
MOZ_CRASH("Bad GPUErrorFilter");
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
|
|
@ -5424,7 +5424,6 @@ bool PresShell::IsTransparentContainerElement() const {
|
|||
case dom::PrefersColorSchemeOverride::Dark:
|
||||
return pc->DefaultBackgroundColorScheme() == ColorScheme::Dark;
|
||||
case dom::PrefersColorSchemeOverride::None:
|
||||
case dom::PrefersColorSchemeOverride::EndGuard_:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -906,7 +906,6 @@ Maybe<ColorScheme> nsPresContext::GetOverriddenOrEmbedderColorScheme() const {
|
|||
case dom::PrefersColorSchemeOverride::Light:
|
||||
return Some(ColorScheme::Light);
|
||||
case dom::PrefersColorSchemeOverride::None:
|
||||
case dom::PrefersColorSchemeOverride::EndGuard_:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -439,7 +439,6 @@ void FontFaceSet::MaybeResolve() {
|
|||
break;
|
||||
case FontFaceLoadStatus::Loading:
|
||||
// We should've returned above at MightHavePendingFontLoads()!
|
||||
case FontFaceLoadStatus::EndGuard_:
|
||||
MOZ_ASSERT_UNREACHABLE("unexpected FontFaceLoadStatus");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -3927,7 +3927,6 @@ HttpBaseChannel::GetRequestMode(RequestMode* aMode) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
HttpBaseChannel::SetRequestMode(RequestMode aMode) {
|
||||
MOZ_ASSERT(aMode != RequestMode::EndGuard_);
|
||||
mRequestMode = aMode;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -169,8 +169,7 @@ fn eval_color_gamut(context: &Context, query_value: Option<ColorGamut>) -> bool
|
|||
// Match if our color gamut is at least as wide as the query value
|
||||
query_value <=
|
||||
match color_gamut {
|
||||
// EndGuard_ is not a valid color gamut, so the default color-gamut is used.
|
||||
ScreenColorGamut::Srgb | ScreenColorGamut::EndGuard_ => ColorGamut::Srgb,
|
||||
ScreenColorGamut::Srgb => ColorGamut::Srgb,
|
||||
ScreenColorGamut::P3 => ColorGamut::P3,
|
||||
ScreenColorGamut::Rec2020 => ColorGamut::Rec2020,
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче