Bug 1833854 - Part 4: Move all code that deals with maintaining invariants into a...
[gecko.git] / dom / fetch / FetchIPCTypes.h
blob343a5acb3fd98f976df783141f75cd2244b2ac11
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_fetch_IPCUtils_h
8 #define mozilla_dom_fetch_IPCUtils_h
10 #include "ipc/EnumSerializer.h"
12 #include "mozilla/dom/HeadersBinding.h"
13 #include "mozilla/dom/RequestBinding.h"
14 #include "mozilla/dom/ResponseBinding.h"
15 #include "mozilla/dom/FetchDriver.h"
17 namespace IPC {
18 template <>
19 struct ParamTraits<mozilla::dom::HeadersGuardEnum>
20 : public ContiguousEnumSerializer<
21 mozilla::dom::HeadersGuardEnum, mozilla::dom::HeadersGuardEnum::None,
22 mozilla::dom::HeadersGuardEnum::EndGuard_> {};
23 template <>
24 struct ParamTraits<mozilla::dom::ReferrerPolicy>
25 : public ContiguousEnumSerializer<mozilla::dom::ReferrerPolicy,
26 mozilla::dom::ReferrerPolicy::_empty,
27 mozilla::dom::ReferrerPolicy::EndGuard_> {
29 template <>
30 struct ParamTraits<mozilla::dom::RequestMode>
31 : public ContiguousEnumSerializer<mozilla::dom::RequestMode,
32 mozilla::dom::RequestMode::Same_origin,
33 mozilla::dom::RequestMode::EndGuard_> {};
34 template <>
35 struct ParamTraits<mozilla::dom::RequestCredentials>
36 : public ContiguousEnumSerializer<
37 mozilla::dom::RequestCredentials,
38 mozilla::dom::RequestCredentials::Omit,
39 mozilla::dom::RequestCredentials::EndGuard_> {};
40 template <>
41 struct ParamTraits<mozilla::dom::RequestCache>
42 : public ContiguousEnumSerializer<mozilla::dom::RequestCache,
43 mozilla::dom::RequestCache::Default,
44 mozilla::dom::RequestCache::EndGuard_> {};
45 template <>
46 struct ParamTraits<mozilla::dom::RequestRedirect>
47 : public ContiguousEnumSerializer<
48 mozilla::dom::RequestRedirect, mozilla::dom::RequestRedirect::Follow,
49 mozilla::dom::RequestRedirect::EndGuard_> {};
50 template <>
51 struct ParamTraits<mozilla::dom::ResponseType>
52 : public ContiguousEnumSerializer<mozilla::dom::ResponseType,
53 mozilla::dom::ResponseType::Basic,
54 mozilla::dom::ResponseType::EndGuard_> {};
55 template <>
56 struct ParamTraits<mozilla::dom::FetchDriverObserver::EndReason>
57 : public ContiguousEnumSerializerInclusive<
58 mozilla::dom::FetchDriverObserver::EndReason,
59 mozilla::dom::FetchDriverObserver::eAborted,
60 mozilla::dom::FetchDriverObserver::eByNetworking> {};
61 } // namespace IPC
63 #endif // mozilla_dom_fetch_IPCUtils_h