diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index b2040b2d09c5..2723714e908b 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -7,7 +7,6 @@ #include "AccessCheck.h" #include "base/basictypes.h" #include "ipc/IPCMessageUtils.h" -#include "ipc/IPCMessageUtilsSpecializations.h" #include "mozilla/EventDispatcher.h" #include "mozilla/BasePrincipal.h" #include "mozilla/ContentEvents.h" diff --git a/dom/events/ScrollAreaEvent.cpp b/dom/events/ScrollAreaEvent.cpp index 4cc7bc61e787..b97700725dee 100644 --- a/dom/events/ScrollAreaEvent.cpp +++ b/dom/events/ScrollAreaEvent.cpp @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "ipc/IPCMessageUtils.h" -#include "ipc/IPCMessageUtilsSpecializations.h" #include "mozilla/dom/DOMRect.h" #include "mozilla/dom/ScrollAreaEvent.h" #include "mozilla/ContentEvents.h" diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index c48a0da60a33..6f2a62887e78 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -15,7 +15,6 @@ #include "mozilla/TouchEvents.h" #include "nsContentUtils.h" #include "nsIDocShell.h" -#include "nsExceptionHandler.h" namespace mozilla::dom { diff --git a/dom/events/UIEvent.cpp b/dom/events/UIEvent.cpp index 0309f6e60ac3..a53f20518a2d 100644 --- a/dom/events/UIEvent.cpp +++ b/dom/events/UIEvent.cpp @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "ipc/IPCMessageUtils.h" -#include "ipc/IPCMessageUtilsSpecializations.h" #include "mozilla/dom/UIEvent.h" #include "mozilla/ArrayUtils.h" #include "mozilla/Assertions.h" diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h index c4526925f77a..ca8904dcc112 100644 --- a/gfx/ipc/GfxMessageUtils.h +++ b/gfx/ipc/GfxMessageUtils.h @@ -12,7 +12,6 @@ #include "RegionBuilder.h" #include "chrome/common/ipc_message_utils.h" #include "gfxFeature.h" -#include "gfxFontUtils.h" #include "gfxFallback.h" #include "gfxPoint.h" #include "gfxRect.h" @@ -24,7 +23,6 @@ #include "mozilla/gfx/Matrix.h" #include "mozilla/gfx/ScaleFactor.h" #include "mozilla/gfx/ScaleFactors2D.h" -#include "SharedFontList.h" #include "nsRect.h" #include "nsRegion.h" #include "mozilla/Array.h" @@ -1138,54 +1136,7 @@ struct ParamTraits : public BitFlagsEnumSerializer {}; -template <> -struct ParamTraits { - typedef gfxSparseBitSet paramType; - static void Write(MessageWriter* aWriter, const paramType& aParam) { - WriteParam(aWriter, aParam.mBlockIndex); - WriteParam(aWriter, aParam.mBlocks); - } - static bool Read(MessageReader* aReader, paramType* aResult) { - return ReadParam(aReader, &aResult->mBlockIndex) && - ReadParam(aReader, &aResult->mBlocks); - } -}; - -template <> -struct ParamTraits { - typedef gfxSparseBitSet::Block paramType; - static void Write(MessageWriter* aWriter, const paramType& aParam) { - aWriter->WriteBytes(&aParam, sizeof(aParam)); - } - static bool Read(MessageReader* aReader, paramType* aResult) { - return aReader->ReadBytesInto(aResult, sizeof(*aResult)); - } -}; - -// The actual FontVisibility enum is defined in gfxTypes.h -template <> -struct ParamTraits - : public ContiguousEnumSerializer {}; - -template <> -struct ParamTraits { - typedef mozilla::fontlist::Pointer paramType; - static void Write(MessageWriter* aWriter, const paramType& aParam) { - uint32_t v = aParam.mBlockAndOffset; - WriteParam(aWriter, v); - } - static bool Read(MessageReader* aReader, paramType* aResult) { - uint32_t v; - if (ReadParam(aReader, &v)) { - aResult->mBlockAndOffset.store(v); - return true; - } - return false; - } -}; - -} // namespace IPC +} /* namespace IPC */ namespace mozilla { namespace ipc { diff --git a/gfx/thebes/SharedFontList.h b/gfx/thebes/SharedFontList.h index 8d97785e7aea..41858a309322 100644 --- a/gfx/thebes/SharedFontList.h +++ b/gfx/thebes/SharedFontList.h @@ -378,6 +378,29 @@ struct LocalFaceRec { } // namespace fontlist } // namespace mozilla +#include "ipc/IPCMessageUtils.h" + +namespace IPC { + +template <> +struct ParamTraits { + typedef mozilla::fontlist::Pointer paramType; + static void Write(MessageWriter* aWriter, const paramType& aParam) { + uint32_t v = aParam.mBlockAndOffset; + WriteParam(aWriter, v); + } + static bool Read(MessageReader* aReader, paramType* aResult) { + uint32_t v; + if (ReadParam(aReader, &v)) { + aResult->mBlockAndOffset.store(v); + return true; + } + return false; + } +}; + +} // namespace IPC + #undef ERROR // This is defined via Windows.h, but conflicts with some bindings // code when this gets included in the same compilation unit. diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 6b7da8954deb..e28796cc72b2 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -21,11 +21,11 @@ #include "mozilla/Mutex.h" #include "mozilla/RefPtr.h" #include "mozilla/RWLock.h" +#include "mozilla/ServoStyleConsts.h" #include "mozilla/TypedEnumBits.h" #include "mozilla/UniquePtr.h" #include "mozilla/gfx/MatrixFwd.h" #include "mozilla/gfx/Point.h" -#include "mozilla/gfx/2D.h" #include "mozilla/intl/UnicodeScriptCodes.h" #include "nsCOMPtr.h" #include "nsColor.h" @@ -43,9 +43,21 @@ #include "nscore.h" #include "DrawMode.h" -// Only required for function bodies +// Only required for function bodys +#include +#include +#include +#include "mozilla/Assertions.h" +#include "mozilla/HashFunctions.h" +#include "mozilla/ServoUtils.h" +#include "mozilla/gfx/2D.h" #include "gfxFontEntry.h" #include "gfxFontFeatures.h" +#include "gfxFontUtils.h" +#include "gfxPlatform.h" +#include "nsAtom.h" +#include "nsDebug.h" +#include "nsMathUtils.h" class gfxContext; class gfxGraphiteShaper; @@ -515,9 +527,6 @@ class gfxTextPerfMetrics { namespace mozilla { namespace gfx { - -class UnscaledFont; - // Flags that live in the gfxShapedText::mFlags field. // (Note that gfxTextRun has an additional mFlags2 field for use // by textrun clients like nsTextFrame.) diff --git a/gfx/thebes/gfxFontEntry.h b/gfx/thebes/gfxFontEntry.h index 757fc1e46c34..d86b4d9d19c9 100644 --- a/gfx/thebes/gfxFontEntry.h +++ b/gfx/thebes/gfxFontEntry.h @@ -15,6 +15,7 @@ #include "gfxRect.h" #include "gfxTypes.h" #include "harfbuzz/hb.h" +#include "ipc/EnumSerializer.h" #include "mozilla/AlreadyAddRefed.h" #include "mozilla/Assertions.h" #include "mozilla/FontPropertyTypes.h" @@ -833,6 +834,14 @@ struct GlobalFontMatch { double mMatchDistance = INFINITY; // metric indicating closest match }; +// The actual FontVisibility enum is defined in gfxTypes.h +namespace IPC { +template <> +struct ParamTraits + : public ContiguousEnumSerializer {}; +} // namespace IPC + class gfxFontFamily { public: // Used by stylo diff --git a/gfx/thebes/gfxFontUtils.h b/gfx/thebes/gfxFontUtils.h index 2b678b5e8582..1e43f5ef61be 100644 --- a/gfx/thebes/gfxFontUtils.h +++ b/gfx/thebes/gfxFontUtils.h @@ -11,6 +11,8 @@ #include #include #include "gfxPlatform.h" +#include "ipc/IPCMessageUtils.h" +#include "ipc/IPCMessageUtilsSpecializations.h" #include "mozilla/Assertions.h" #include "mozilla/Attributes.h" #include "mozilla/Casting.h" @@ -49,11 +51,6 @@ typedef struct hb_blob_t hb_blob_t; class SharedBitSet; -namespace IPC { -template -struct ParamTraits; -} - class gfxSparseBitSet { private: friend class SharedBitSet; @@ -69,9 +66,6 @@ class gfxSparseBitSet { uint8_t mBits[BLOCK_SIZE]; }; - friend struct IPC::ParamTraits; - friend struct IPC::ParamTraits; - public: gfxSparseBitSet() = default; @@ -337,10 +331,38 @@ class gfxSparseBitSet { } private: + friend struct IPC::ParamTraits; + friend struct IPC::ParamTraits; CopyableTArray mBlockIndex; CopyableTArray mBlocks; }; +namespace IPC { +template <> +struct ParamTraits { + typedef gfxSparseBitSet paramType; + static void Write(MessageWriter* aWriter, const paramType& aParam) { + WriteParam(aWriter, aParam.mBlockIndex); + WriteParam(aWriter, aParam.mBlocks); + } + static bool Read(MessageReader* aReader, paramType* aResult) { + return ReadParam(aReader, &aResult->mBlockIndex) && + ReadParam(aReader, &aResult->mBlocks); + } +}; + +template <> +struct ParamTraits { + typedef gfxSparseBitSet::Block paramType; + static void Write(MessageWriter* aWriter, const paramType& aParam) { + aWriter->WriteBytes(&aParam, sizeof(aParam)); + } + static bool Read(MessageReader* aReader, paramType* aResult) { + return aReader->ReadBytesInto(aResult, sizeof(*aResult)); + } +}; +} // namespace IPC + /** * SharedBitSet is a version of gfxSparseBitSet that is intended to be used * in a shared-memory block, and can be used regardless of the address at which