/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(XP_UNIX) // This condition must be kept in sync with the one in // ipc_message_utils.h, but this dummy definition of // base::FileDescriptor acts as a static assert that we only get one // def or the other (or neither, in which case code using // FileDescriptor fails to build) namespace base { struct FileDescriptor {};
} // namespace base #endif
namespace mozilla { template <typename...> class Variant;
/** * 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.
*/ template <typename T> struct EmptyStructSerializer { typedef T paramType;
// Helper class for reading bitfields. // If T has bitfields members, derive ParamTraits<T> from BitfieldHelper<T>. template <typename ParamType> struct BitfieldHelper { // We need this helper because we can't get the address of a bitfield to // pass directly to ReadParam. So instead we read it into a temporary bool // and set the bitfield using a setter function staticbool ReadBoolForBitfield(MessageReader* aReader, ParamType* aResult, void (ParamType::*aSetter)(bool)) { bool value; if (ReadParam(aReader, &value)) {
(aResult->*aSetter)(value); returntrue;
} returnfalse;
}
};
// Macros that allow syntax like: // DEFINE_IPC_SERIALIZER_WITH_FIELDS(SomeType, member1, member2, member3) // Makes sure that serialize/deserialize code do the same members in the same // order. #define ACCESS_PARAM_FIELD(Field) aParam.Field
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.