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/. */
6 
7 #ifndef mozilla_dom_fetch_IPCUtils_h
8 #define mozilla_dom_fetch_IPCUtils_h
9 
10 #include "ipc/IPCMessageUtils.h"
11 
12 // Fix X11 header brain damage that conflicts with HeadersGuardEnum::None
13 #undef None
14 
15 #include "mozilla/dom/HeadersBinding.h"
16 #include "mozilla/dom/RequestBinding.h"
17 #include "mozilla/dom/ResponseBinding.h"
18 
19 namespace IPC {
20   template<>
21   struct ParamTraits<mozilla::dom::HeadersGuardEnum> :
22     public ContiguousEnumSerializer<mozilla::dom::HeadersGuardEnum,
23                                     mozilla::dom::HeadersGuardEnum::None,
24                                     mozilla::dom::HeadersGuardEnum::EndGuard_> {};
25   template<>
26   struct ParamTraits<mozilla::dom::ReferrerPolicy> :
27     public ContiguousEnumSerializer<mozilla::dom::ReferrerPolicy,
28                                     mozilla::dom::ReferrerPolicy::_empty,
29                                     mozilla::dom::ReferrerPolicy::EndGuard_> {};
30   template<>
31   struct ParamTraits<mozilla::dom::RequestMode> :
32     public ContiguousEnumSerializer<mozilla::dom::RequestMode,
33                                     mozilla::dom::RequestMode::Same_origin,
34                                     mozilla::dom::RequestMode::EndGuard_> {};
35   template<>
36   struct ParamTraits<mozilla::dom::RequestCredentials> :
37     public ContiguousEnumSerializer<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<mozilla::dom::RequestRedirect,
48                                     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 } // namespace IPC
56 
57 #endif // mozilla_dom_fetch_IPCUtils_h
58