mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 02:14:43 +00:00
Bug 1111290 - Part 2: Non-mechanical changes. r=waldo
This commit is contained in:
parent
be535304d8
commit
86502e6537
@ -23,10 +23,10 @@ public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasGradient)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasGradient)
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(Type, uint8_t)
|
||||
enum class Type : uint8_t {
|
||||
LINEAR = 0,
|
||||
RADIAL
|
||||
MOZ_END_NESTED_ENUM_CLASS(Type)
|
||||
};
|
||||
|
||||
Type GetType()
|
||||
{
|
||||
@ -75,8 +75,6 @@ protected:
|
||||
virtual ~CanvasGradient() {}
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasGradient::Type)
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
||||
|
@ -29,12 +29,12 @@ public:
|
||||
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern)
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(RepeatMode, uint8_t)
|
||||
enum class RepeatMode : uint8_t {
|
||||
REPEAT,
|
||||
REPEATX,
|
||||
REPEATY,
|
||||
NOREPEAT
|
||||
MOZ_END_NESTED_ENUM_CLASS(RepeatMode)
|
||||
};
|
||||
|
||||
CanvasPattern(CanvasRenderingContext2D* aContext,
|
||||
gfx::SourceSurface* aSurface,
|
||||
@ -74,8 +74,6 @@ public:
|
||||
const RepeatMode mRepeat;
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasPattern::RepeatMode)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -543,17 +543,17 @@ public:
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(CanvasRenderingContext2D)
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(CanvasMultiGetterType, uint8_t)
|
||||
enum class CanvasMultiGetterType : uint8_t {
|
||||
STRING = 0,
|
||||
PATTERN = 1,
|
||||
GRADIENT = 2
|
||||
MOZ_END_NESTED_ENUM_CLASS(CanvasMultiGetterType)
|
||||
};
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(Style, uint8_t)
|
||||
enum class Style : uint8_t {
|
||||
STROKE = 0,
|
||||
FILL,
|
||||
MAX
|
||||
MOZ_END_NESTED_ENUM_CLASS(Style)
|
||||
};
|
||||
|
||||
nsINode* GetParentObject()
|
||||
{
|
||||
@ -891,31 +891,29 @@ protected:
|
||||
|
||||
// text
|
||||
|
||||
public: // These enums are public only to accomodate non-C++11 legacy path of
|
||||
// MOZ_FINISH_NESTED_ENUM_CLASS. Can move back to protected as soon
|
||||
// as that legacy path is dropped.
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(TextAlign, uint8_t)
|
||||
protected:
|
||||
enum class TextAlign : uint8_t {
|
||||
START,
|
||||
END,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
CENTER
|
||||
MOZ_END_NESTED_ENUM_CLASS(TextAlign)
|
||||
};
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(TextBaseline, uint8_t)
|
||||
enum class TextBaseline : uint8_t {
|
||||
TOP,
|
||||
HANGING,
|
||||
MIDDLE,
|
||||
ALPHABETIC,
|
||||
IDEOGRAPHIC,
|
||||
BOTTOM
|
||||
MOZ_END_NESTED_ENUM_CLASS(TextBaseline)
|
||||
};
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(TextDrawOperation, uint8_t)
|
||||
enum class TextDrawOperation : uint8_t {
|
||||
FILL,
|
||||
STROKE,
|
||||
MEASURE
|
||||
MOZ_END_NESTED_ENUM_CLASS(TextDrawOperation)
|
||||
};
|
||||
|
||||
protected:
|
||||
gfxFontGroup *GetCurrentFontStyle();
|
||||
@ -1104,12 +1102,6 @@ protected:
|
||||
friend class CanvasDrawObserver;
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasRenderingContext2D::CanvasMultiGetterType)
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasRenderingContext2D::Style)
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasRenderingContext2D::TextAlign)
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasRenderingContext2D::TextBaseline)
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CanvasRenderingContext2D::TextDrawOperation)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ class WebGLImageConverter
|
||||
* texels with typed pointers and this value will tell us by how much we need
|
||||
* to increment these pointers to advance to the next texel.
|
||||
*/
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
static size_t NumElementsPerTexelForFormat() {
|
||||
switch (Format) {
|
||||
case WebGLTexelFormat::R8:
|
||||
@ -78,9 +78,9 @@ class WebGLImageConverter
|
||||
* to return immediately in these cases to allow the compiler to avoid generating
|
||||
* useless code.
|
||||
*/
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) SrcFormat,
|
||||
MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) DstFormat,
|
||||
MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelPremultiplicationOp) PremultiplicationOp>
|
||||
template<WebGLTexelFormat SrcFormat,
|
||||
WebGLTexelFormat DstFormat,
|
||||
WebGLTexelPremultiplicationOp PremultiplicationOp>
|
||||
void run()
|
||||
{
|
||||
// check for never-called cases. We early-return to allow the compiler
|
||||
@ -151,9 +151,9 @@ class WebGLImageConverter
|
||||
typename DataTypeForFormat<DstFormat>::Type
|
||||
DstType;
|
||||
|
||||
const MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) IntermediateSrcFormat
|
||||
const WebGLTexelFormat IntermediateSrcFormat
|
||||
= IntermediateFormat<SrcFormat>::Value;
|
||||
const MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) IntermediateDstFormat
|
||||
const WebGLTexelFormat IntermediateDstFormat
|
||||
= IntermediateFormat<DstFormat>::Value;
|
||||
typedef
|
||||
typename DataTypeForFormat<IntermediateSrcFormat>::Type
|
||||
@ -218,8 +218,8 @@ class WebGLImageConverter
|
||||
return;
|
||||
}
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) SrcFormat,
|
||||
MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) DstFormat>
|
||||
template<WebGLTexelFormat SrcFormat,
|
||||
WebGLTexelFormat DstFormat>
|
||||
void run(WebGLTexelPremultiplicationOp premultiplicationOp)
|
||||
{
|
||||
#define WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP(PremultiplicationOp) \
|
||||
@ -237,7 +237,7 @@ class WebGLImageConverter
|
||||
#undef WEBGLIMAGECONVERTER_CASE_PREMULTIPLICATIONOP
|
||||
}
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) SrcFormat>
|
||||
template<WebGLTexelFormat SrcFormat>
|
||||
void run(WebGLTexelFormat dstFormat,
|
||||
WebGLTexelPremultiplicationOp premultiplicationOp)
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ enum class WebGLTexelPremultiplicationOp : int {
|
||||
|
||||
namespace WebGLTexelConversions {
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct IsFloatFormat
|
||||
{
|
||||
static const bool Value =
|
||||
@ -166,7 +166,7 @@ struct IsFloatFormat
|
||||
Format == WebGLTexelFormat::A32F;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct IsHalfFloatFormat
|
||||
{
|
||||
static const bool Value =
|
||||
@ -177,7 +177,7 @@ struct IsHalfFloatFormat
|
||||
Format == WebGLTexelFormat::A16F;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct Is16bppFormat
|
||||
{
|
||||
static const bool Value =
|
||||
@ -186,7 +186,7 @@ struct Is16bppFormat
|
||||
Format == WebGLTexelFormat::RGB565;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format,
|
||||
template<WebGLTexelFormat Format,
|
||||
bool IsFloat = IsFloatFormat<Format>::Value,
|
||||
bool Is16bpp = Is16bppFormat<Format>::Value,
|
||||
bool IsHalfFloat = IsHalfFloatFormat<Format>::Value>
|
||||
@ -195,28 +195,28 @@ struct DataTypeForFormat
|
||||
typedef uint8_t Type;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct DataTypeForFormat<Format, true, false, false>
|
||||
{
|
||||
typedef float Type;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct DataTypeForFormat<Format, false, true, false>
|
||||
{
|
||||
typedef uint16_t Type;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct DataTypeForFormat<Format, false, false, true>
|
||||
{
|
||||
typedef uint16_t Type;
|
||||
};
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format>
|
||||
template<WebGLTexelFormat Format>
|
||||
struct IntermediateFormat
|
||||
{
|
||||
static const MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Value
|
||||
static const WebGLTexelFormat Value
|
||||
= IsFloatFormat<Format>::Value
|
||||
? WebGLTexelFormat::RGBA32F
|
||||
: IsHalfFloatFormat<Format>::Value ? WebGLTexelFormat::RGBA16F
|
||||
@ -332,7 +332,7 @@ MOZ_ALWAYS_INLINE bool HasColor(WebGLTexelFormat format) {
|
||||
//----------------------------------------------------------------------
|
||||
// Pixel unpacking routines.
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format, typename SrcType, typename DstType>
|
||||
template<WebGLTexelFormat Format, typename SrcType, typename DstType>
|
||||
MOZ_ALWAYS_INLINE void
|
||||
unpack(const SrcType* __restrict src,
|
||||
DstType* __restrict dst)
|
||||
@ -537,8 +537,8 @@ unpack<WebGLTexelFormat::A16F, uint16_t, uint16_t>(const uint16_t* __restrict sr
|
||||
// Pixel packing routines.
|
||||
//
|
||||
|
||||
template<MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelFormat) Format,
|
||||
MOZ_ENUM_CLASS_ENUM_TYPE(WebGLTexelPremultiplicationOp) PremultiplicationOp,
|
||||
template<WebGLTexelFormat Format,
|
||||
WebGLTexelPremultiplicationOp PremultiplicationOp,
|
||||
typename SrcType,
|
||||
typename DstType>
|
||||
MOZ_ALWAYS_INLINE void
|
||||
|
@ -1025,11 +1025,11 @@ protected:
|
||||
bool mIsAudioPrerolling;
|
||||
bool mIsVideoPrerolling;
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(RequestStatus)
|
||||
enum class RequestStatus {
|
||||
Idle,
|
||||
Pending,
|
||||
Waiting
|
||||
MOZ_END_NESTED_ENUM_CLASS(RequestStatus)
|
||||
};
|
||||
|
||||
// True when we have dispatched a task to the decode task queue to request
|
||||
// decoded audio/video, and/or we are waiting for the requested sample to be
|
||||
|
@ -198,7 +198,7 @@ struct ParamTraits<gfxRect>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<gfxContentType>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
gfxContentType,
|
||||
gfxContentType::COLOR,
|
||||
gfxContentType::SENTINEL>
|
||||
@ -206,7 +206,7 @@ struct ParamTraits<gfxContentType>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<gfxSurfaceType>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
gfxSurfaceType,
|
||||
gfxSurfaceType::Image,
|
||||
gfxSurfaceType::Max>
|
||||
@ -222,7 +222,7 @@ struct ParamTraits<mozilla::GraphicsFilterType>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::LayersBackend>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::layers::LayersBackend,
|
||||
mozilla::layers::LayersBackend::LAYERS_NONE,
|
||||
mozilla::layers::LayersBackend::LAYERS_LAST>
|
||||
@ -230,7 +230,7 @@ struct ParamTraits<mozilla::layers::LayersBackend>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::ScaleMode>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::layers::ScaleMode,
|
||||
mozilla::layers::ScaleMode::SCALE_NONE,
|
||||
mozilla::layers::ScaleMode::SENTINEL>
|
||||
@ -238,7 +238,7 @@ struct ParamTraits<mozilla::layers::ScaleMode>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<gfxImageFormat>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
gfxImageFormat,
|
||||
gfxImageFormat::ARGB32,
|
||||
gfxImageFormat::Unknown>
|
||||
@ -254,7 +254,7 @@ struct ParamTraits<mozilla::gfx::AttributeName>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::gfx::AttributeType>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::gfx::AttributeType,
|
||||
mozilla::gfx::AttributeType::eBool,
|
||||
mozilla::gfx::AttributeType::Max>
|
||||
@ -262,7 +262,7 @@ struct ParamTraits<mozilla::gfx::AttributeType>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::gfx::PrimitiveType>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::gfx::PrimitiveType,
|
||||
mozilla::gfx::PrimitiveType::Empty,
|
||||
mozilla::gfx::PrimitiveType::Max>
|
||||
@ -270,7 +270,7 @@ struct ParamTraits<mozilla::gfx::PrimitiveType>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::gfx::ColorSpace>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::gfx::ColorSpace,
|
||||
mozilla::gfx::ColorSpace::SRGB,
|
||||
mozilla::gfx::ColorSpace::Max>
|
||||
@ -278,14 +278,14 @@ struct ParamTraits<mozilla::gfx::ColorSpace>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::TextureFlags>
|
||||
: public BitFlagsTypedEnumSerializer<
|
||||
: public BitFlagsEnumSerializer<
|
||||
mozilla::layers::TextureFlags,
|
||||
mozilla::layers::TextureFlags::ALL_BITS>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::TextureIdentifier>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::layers::TextureIdentifier,
|
||||
mozilla::layers::TextureIdentifier::Front,
|
||||
mozilla::layers::TextureIdentifier::HighBound>
|
||||
@ -293,14 +293,14 @@ struct ParamTraits<mozilla::layers::TextureIdentifier>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::DeprecatedTextureHostFlags>
|
||||
: public BitFlagsTypedEnumSerializer<
|
||||
: public BitFlagsEnumSerializer<
|
||||
mozilla::layers::DeprecatedTextureHostFlags,
|
||||
mozilla::layers::DeprecatedTextureHostFlags::ALL_BITS>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::DiagnosticTypes>
|
||||
: public BitFlagsTypedEnumSerializer<
|
||||
: public BitFlagsEnumSerializer<
|
||||
mozilla::layers::DiagnosticTypes,
|
||||
mozilla::layers::DiagnosticTypes::ALL_BITS>
|
||||
{};
|
||||
@ -854,7 +854,7 @@ struct ParamTraits<mozilla::layers::TextureInfo>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::layers::CompositableType>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::layers::CompositableType,
|
||||
mozilla::layers::CompositableType::UNKNOWN,
|
||||
mozilla::layers::CompositableType::COUNT>
|
||||
@ -862,7 +862,7 @@ struct ParamTraits<mozilla::layers::CompositableType>
|
||||
|
||||
template <>
|
||||
struct ParamTraits<mozilla::gfx::SurfaceFormat>
|
||||
: public ContiguousTypedEnumSerializer<
|
||||
: public ContiguousEnumSerializer<
|
||||
mozilla::gfx::SurfaceFormat,
|
||||
mozilla::gfx::SurfaceFormat::B8G8R8A8,
|
||||
mozilla::gfx::SurfaceFormat::UNKNOWN>
|
||||
|
@ -89,9 +89,9 @@ public:
|
||||
|
||||
static TemporaryRef<SyncObject> CreateSyncObject(SyncHandle aHandle);
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(SyncType)
|
||||
enum class SyncType {
|
||||
D3D11,
|
||||
MOZ_END_NESTED_ENUM_CLASS(SyncType)
|
||||
};
|
||||
|
||||
virtual SyncType GetSyncType() = 0;
|
||||
virtual void FinalizeFrame() = 0;
|
||||
|
@ -78,14 +78,14 @@ private:
|
||||
|
||||
private:
|
||||
// Enums for the update policy.
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(UpdatePolicy)
|
||||
enum class UpdatePolicy {
|
||||
Skip, // Set the value to default, skip any Preferences calls
|
||||
Once, // Evaluate the preference once, unchanged during the session
|
||||
Live // Evaluate the preference and set callback so it stays current/live
|
||||
MOZ_END_NESTED_ENUM_CLASS(UpdatePolicy)
|
||||
};
|
||||
|
||||
// Since we cannot use const char*, use a function that returns it.
|
||||
template <MOZ_ENUM_CLASS_ENUM_TYPE(UpdatePolicy) Update, class T, T Default(void), const char* Pref(void)>
|
||||
template <UpdatePolicy Update, class T, T Default(void), const char* Pref(void)>
|
||||
class PrefTemplate
|
||||
{
|
||||
public:
|
||||
|
@ -129,18 +129,7 @@ struct EnumSerializer {
|
||||
template <typename E,
|
||||
E MinLegal,
|
||||
E HighBound>
|
||||
struct ContiguousEnumValidator
|
||||
{
|
||||
static bool IsLegalValue(E e)
|
||||
{
|
||||
return MinLegal <= e && e < HighBound;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename E,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) MinLegal,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) HighBound>
|
||||
class ContiguousTypedEnumValidator
|
||||
class ContiguousEnumValidator
|
||||
{
|
||||
// Silence overzealous -Wtype-limits bug in GCC fixed in GCC 4.8:
|
||||
// "comparison of unsigned expression >= 0 is always true"
|
||||
@ -151,9 +140,7 @@ class ContiguousTypedEnumValidator
|
||||
public:
|
||||
static bool IsLegalValue(E e)
|
||||
{
|
||||
typedef MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) ActualEnumType;
|
||||
return IsLessThanOrEqual(MinLegal, ActualEnumType(e)) &&
|
||||
ActualEnumType(e) < HighBound;
|
||||
return IsLessThanOrEqual(MinLegal, e) && e < HighBound;
|
||||
}
|
||||
};
|
||||
|
||||
@ -167,16 +154,6 @@ struct BitFlagsEnumValidator
|
||||
}
|
||||
};
|
||||
|
||||
template <typename E,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) AllBits>
|
||||
struct BitFlagsTypedEnumValidator
|
||||
{
|
||||
static bool IsLegalValue(E e)
|
||||
{
|
||||
return (e & AllBits) == e;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Specialization of EnumSerializer for enums with contiguous enum values.
|
||||
*
|
||||
@ -201,19 +178,6 @@ struct ContiguousEnumSerializer
|
||||
ContiguousEnumValidator<E, MinLegal, HighBound>>
|
||||
{};
|
||||
|
||||
/**
|
||||
* Similar to ContiguousEnumSerializer, but for MFBT typed enums
|
||||
* as constructed by MOZ_BEGIN_ENUM_CLASS. This can go away when
|
||||
* we drop MOZ_BEGIN_ENUM_CLASS and use C++11 enum classes directly.
|
||||
*/
|
||||
template <typename E,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) MinLegal,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) HighBound>
|
||||
struct ContiguousTypedEnumSerializer
|
||||
: EnumSerializer<E,
|
||||
ContiguousTypedEnumValidator<E, MinLegal, HighBound>>
|
||||
{};
|
||||
|
||||
/**
|
||||
* Specialization of EnumSerializer for enums representing bit flags.
|
||||
*
|
||||
@ -241,18 +205,6 @@ struct BitFlagsEnumSerializer
|
||||
BitFlagsEnumValidator<E, AllBits>>
|
||||
{};
|
||||
|
||||
/**
|
||||
* Similar to BitFlagsEnumSerializer, but for MFBT typed enums
|
||||
* as constructed by MOZ_BEGIN_ENUM_CLASS. This can go away when
|
||||
* we drop MOZ_BEGIN_ENUM_CLASS and use C++11 enum classes directly.
|
||||
*/
|
||||
template <typename E,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(E) AllBits>
|
||||
struct BitFlagsTypedEnumSerializer
|
||||
: EnumSerializer<E,
|
||||
BitFlagsTypedEnumValidator<E, AllBits>>
|
||||
{};
|
||||
|
||||
template <>
|
||||
struct ParamTraits<base::ChildPrivileges>
|
||||
: public ContiguousEnumSerializer<base::ChildPrivileges,
|
||||
|
@ -73,7 +73,7 @@ class ProfileEntry
|
||||
};
|
||||
|
||||
// Keep these in sync with browser/devtools/profiler/utils/global.js
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(Category, uint32_t)
|
||||
enum class Category : uint32_t {
|
||||
OTHER = 0x10,
|
||||
CSS = 0x20,
|
||||
JS = 0x40,
|
||||
@ -86,7 +86,7 @@ class ProfileEntry
|
||||
|
||||
FIRST = OTHER,
|
||||
LAST = EVENTS
|
||||
MOZ_END_NESTED_ENUM_CLASS(Category)
|
||||
};
|
||||
|
||||
// All of these methods are marked with the 'volatile' keyword because SPS's
|
||||
// representation of the stack is stored such that all ProfileEntry
|
||||
|
@ -163,10 +163,10 @@ public:
|
||||
*/
|
||||
static bool GetDisplayPort(nsIContent* aContent, nsRect *aResult = nullptr);
|
||||
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(RepaintMode, uint8_t)
|
||||
enum class RepaintMode : uint8_t {
|
||||
Repaint,
|
||||
DoNotRepaint
|
||||
MOZ_END_NESTED_ENUM_CLASS(RepaintMode)
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the display port margins for a content element to be used with a
|
||||
@ -2577,8 +2577,6 @@ private:
|
||||
static bool IsAPZTestLoggingEnabled();
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(nsLayoutUtils::RepaintMode)
|
||||
|
||||
template<typename PointType, typename RectType, typename CoordType>
|
||||
/* static */ bool
|
||||
nsLayoutUtils::PointIsCloserToRect(PointType aPoint, const RectType& aRect,
|
||||
|
@ -16,8 +16,7 @@ namespace mozilla {
|
||||
|
||||
/**
|
||||
* EnumeratedArray is a fixed-size array container for use when an
|
||||
* array is indexed by a specific enum class, as currently implemented
|
||||
* by MOZ_BEGIN_ENUM_CLASS.
|
||||
* array is indexed by a specific enum class.
|
||||
*
|
||||
* This provides type safety by guarding at compile time against accidentally
|
||||
* indexing such arrays with unrelated values. This also removes the need
|
||||
@ -40,7 +39,7 @@ namespace mozilla {
|
||||
*
|
||||
*/
|
||||
template<typename IndexType,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(IndexType) SizeAsEnumValue,
|
||||
IndexType SizeAsEnumValue,
|
||||
typename ValueType>
|
||||
class EnumeratedArray
|
||||
{
|
||||
|
@ -212,7 +212,7 @@ private:
|
||||
public:
|
||||
// Two conditions, JSOutOfMemory and JSLargeAllocationFailure, are noted in
|
||||
// crash reports. Here are the values that can appear in the reports:
|
||||
MOZ_BEGIN_NESTED_ENUM_CLASS(OOMState, uint32_t)
|
||||
enum class OOMState : uint32_t {
|
||||
// The condition has never happened. No entry appears in the crash report.
|
||||
OK,
|
||||
|
||||
@ -240,7 +240,7 @@ public:
|
||||
// GC is taken as a proxy for "we've been banging on the heap a good bit
|
||||
// now and haven't crashed; the OOM was probably handled correctly".
|
||||
Recovered
|
||||
MOZ_END_NESTED_ENUM_CLASS(OOMState)
|
||||
};
|
||||
|
||||
private:
|
||||
void AnnotateAndSetOutOfMemory(OOMState* aStatePtr, OOMState aNewState);
|
||||
@ -316,8 +316,6 @@ private:
|
||||
OOMState mLargeAllocationFailureState;
|
||||
};
|
||||
|
||||
MOZ_FINISH_NESTED_ENUM_CLASS(CycleCollectedJSRuntime::OOMState)
|
||||
|
||||
void TraceScriptHolder(nsISupports* aHolder, JSTracer* aTracer);
|
||||
|
||||
// Returns true if the JSGCTraceKind is one the cycle collector cares about.
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "nsCycleCollectionTraversalCallback.h"
|
||||
|
||||
template<typename IndexType,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(IndexType) SizeAsEnumValue,
|
||||
IndexType SizeAsEnumValue,
|
||||
typename ValueType>
|
||||
inline void
|
||||
ImplCycleCollectionUnlink(mozilla::EnumeratedArray<IndexType,
|
||||
@ -24,7 +24,7 @@ ImplCycleCollectionUnlink(mozilla::EnumeratedArray<IndexType,
|
||||
}
|
||||
|
||||
template<typename IndexType,
|
||||
MOZ_TEMPLATE_ENUM_CLASS_ENUM_TYPE(IndexType) SizeAsEnumValue,
|
||||
IndexType SizeAsEnumValue,
|
||||
typename ValueType>
|
||||
inline void
|
||||
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
|
Loading…
Reference in New Issue
Block a user