Bug 1688354 [wpt PR 27298] - Treat 'rem' as an absolute unit for font size, a=testonly
[gecko.git] / dom / quota / SerializationHelpers.h
blob06534185d29c2e1b08c3ab3d43a628317a244719
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_quota_SerializationHelpers_h
8 #define mozilla_dom_quota_SerializationHelpers_h
10 #include "ipc/EnumSerializer.h"
11 #include "ipc/IPCMessageUtils.h"
13 #include "mozilla/dom/quota/Client.h"
14 #include "mozilla/dom/quota/PersistenceType.h"
15 #include "mozilla/OriginAttributes.h"
17 namespace IPC {
19 template <>
20 struct ParamTraits<mozilla::dom::quota::PersistenceType>
21 : public ContiguousEnumSerializer<
22 mozilla::dom::quota::PersistenceType,
23 mozilla::dom::quota::PERSISTENCE_TYPE_PERSISTENT,
24 mozilla::dom::quota::PERSISTENCE_TYPE_INVALID> {};
26 template <>
27 struct ParamTraits<mozilla::dom::quota::Client::Type>
28 : public ContiguousEnumSerializer<mozilla::dom::quota::Client::Type,
29 mozilla::dom::quota::Client::IDB,
30 mozilla::dom::quota::Client::TYPE_MAX> {};
32 template <>
33 struct ParamTraits<mozilla::OriginAttributesPattern> {
34 typedef mozilla::OriginAttributesPattern paramType;
36 static void Write(Message* aMsg, const paramType& aParam) {
37 WriteParam(aMsg, aParam.mFirstPartyDomain);
38 WriteParam(aMsg, aParam.mInIsolatedMozBrowser);
39 WriteParam(aMsg, aParam.mPrivateBrowsingId);
40 WriteParam(aMsg, aParam.mUserContextId);
41 WriteParam(aMsg, aParam.mGeckoViewSessionContextId);
44 static bool Read(const Message* aMsg, PickleIterator* aIter,
45 paramType* aResult) {
46 return ReadParam(aMsg, aIter, &aResult->mFirstPartyDomain) &&
47 ReadParam(aMsg, aIter, &aResult->mInIsolatedMozBrowser) &&
48 ReadParam(aMsg, aIter, &aResult->mPrivateBrowsingId) &&
49 ReadParam(aMsg, aIter, &aResult->mUserContextId) &&
50 ReadParam(aMsg, aIter, &aResult->mGeckoViewSessionContextId);
54 } // namespace IPC
56 #endif // mozilla_dom_quota_SerializationHelpers_h