no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / ipc / DocShellMessageUtils.h
blob934ba77f48a08cbd70183f0faee40fcb487f5436
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_docshell_message_utils_h__
8 #define mozilla_dom_docshell_message_utils_h__
10 #include "ipc/EnumSerializer.h"
11 #include "nsCOMPtr.h"
12 #include "nsDocShellLoadState.h"
13 #include "nsIDocumentViewer.h"
14 #include "mozilla/ScrollbarPreferences.h"
15 #include "mozilla/ipc/IPDLParamTraits.h"
17 namespace IPC {
19 template <>
20 struct ParamTraits<nsDocShellLoadState*> {
21 static void Write(IPC::MessageWriter* aWriter, nsDocShellLoadState* aParam);
22 static bool Read(IPC::MessageReader* aReader,
23 RefPtr<nsDocShellLoadState>* aResult);
26 template <>
27 struct ParamTraits<mozilla::ScrollbarPreference>
28 : public ContiguousEnumSerializerInclusive<
29 mozilla::ScrollbarPreference, mozilla::ScrollbarPreference::Auto,
30 mozilla::ScrollbarPreference::LAST> {};
32 template <>
33 struct ParamTraits<mozilla::dom::PermitUnloadResult>
34 : public ContiguousEnumSerializerInclusive<
35 mozilla::dom::PermitUnloadResult,
36 mozilla::dom::PermitUnloadResult::eAllowNavigation,
37 mozilla::dom::PermitUnloadResult::eRequestBlockNavigation> {};
39 template <>
40 struct ParamTraits<mozilla::dom::XPCOMPermitUnloadAction>
41 : public ContiguousEnumSerializerInclusive<
42 mozilla::dom::XPCOMPermitUnloadAction,
43 mozilla::dom::XPCOMPermitUnloadAction::ePrompt,
44 mozilla::dom::XPCOMPermitUnloadAction::eDontPromptAndUnload> {};
46 } // namespace IPC
48 #endif // mozilla_dom_docshell_message_utils_h__