diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index cdcd3c574a60..22faac9cf95e 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -47,36 +47,6 @@ struct VariantTag; namespace IPC { -/** - * A helper class for serializing plain-old data (POD) structures. - * The memory representation of the structure is written to and read from - * the serialized stream directly, without individual processing of the - * structure's members. - * - * Derive ParamTraits from PlainOldDataSerializer if T is POD. - * - * Note: For POD structures with enumeration fields, this will not do - * validation of the enum values the way serializing the fields - * individually would. Prefer serializing the fields individually - * in such cases. - */ -template -struct PlainOldDataSerializer { - static_assert( - std::is_trivially_copyable::value, - "PlainOldDataSerializer can only be used with trivially copyable types!"); - - typedef T 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(paramType)); - } -}; - /** * A helper class for serializing empty structs. Since the struct is empty there * is nothing to write, and a priori we know the result of the read.