Bug 1454293 [wpt PR 10484] - null is not the correct origin for createDocument()...
[gecko.git] / widget / WidgetMessageUtils.h
blob407a27e33c3b92eaa01f032ab213c9dcaffee53b
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_WidgetMessageUtils_h
6 #define mozilla_WidgetMessageUtils_h
8 #include "ipc/IPCMessageUtils.h"
9 #include "mozilla/LookAndFeel.h"
10 #include "nsIWidget.h"
12 namespace IPC {
14 template<>
15 struct ParamTraits<LookAndFeelInt>
17 typedef LookAndFeelInt paramType;
19 static void Write(Message* aMsg, const paramType& aParam)
21 WriteParam(aMsg, aParam.id);
22 WriteParam(aMsg, aParam.value);
25 static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
27 int32_t id, value;
28 if (ReadParam(aMsg, aIter, &id) &&
29 ReadParam(aMsg, aIter, &value)) {
30 aResult->id = id;
31 aResult->value = value;
32 return true;
34 return false;
38 template<>
39 struct ParamTraits<nsTransparencyMode> : public ContiguousEnumSerializerInclusive<nsTransparencyMode, eTransparencyOpaque, eTransparencyBorderlessGlass>
40 { };
42 template<>
43 struct ParamTraits<nsCursor>
44 : public ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount>
48 } // namespace IPC
50 #endif // WidgetMessageUtils_h