Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / ipc / glue / TransportSecurityInfoUtils.h
blob0228f9bae9eb7b13340cf573d4bf129cf08af603
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_ipc_TransportSecurityInfoUtils_h
6 #define mozilla_ipc_TransportSecurityInfoUtils_h
8 #include "CertVerifier.h"
9 #include "ipc/EnumSerializer.h"
10 #include "mozilla/RefPtr.h"
11 #include "nsITransportSecurityInfo.h"
12 #include "nsIX509Cert.h"
14 class MessageReader;
15 class MessageWriter;
17 namespace IPC {
19 template <typename>
20 struct ParamTraits;
22 template <>
23 struct ParamTraits<nsITransportSecurityInfo*> {
24 static void Write(MessageWriter* aWriter, nsITransportSecurityInfo* aParam);
25 static bool Read(MessageReader* aReader,
26 RefPtr<nsITransportSecurityInfo>* aResult);
29 template <>
30 struct ParamTraits<nsIX509Cert*> {
31 static void Write(MessageWriter* aWriter, nsIX509Cert* aCert);
32 static bool Read(MessageReader* aReader, RefPtr<nsIX509Cert>* aResult);
35 template <>
36 struct ParamTraits<nsITransportSecurityInfo::OverridableErrorCategory>
37 : public ContiguousEnumSerializerInclusive<
38 nsITransportSecurityInfo::OverridableErrorCategory,
39 nsITransportSecurityInfo::OverridableErrorCategory::ERROR_UNSET,
40 nsITransportSecurityInfo::OverridableErrorCategory::ERROR_TIME> {};
42 template <>
43 struct ParamTraits<mozilla::psm::EVStatus>
44 : public ContiguousEnumSerializerInclusive<mozilla::psm::EVStatus,
45 mozilla::psm::EVStatus::NotEV,
46 mozilla::psm::EVStatus::EV> {};
48 } // namespace IPC
50 #endif // mozilla_ipc_TransportSecurityInfoUtils_h