Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/widget/WidgetMessageUtils.h
Line
Count
Source (jump to first uncovered line)
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/. */
4
5
#ifndef mozilla_WidgetMessageUtils_h
6
#define mozilla_WidgetMessageUtils_h
7
8
#include "ipc/IPCMessageUtils.h"
9
#include "mozilla/LookAndFeel.h"
10
#include "nsIWidget.h"
11
12
namespace IPC {
13
14
template<>
15
struct ParamTraits<LookAndFeelInt>
16
{
17
  typedef LookAndFeelInt paramType;
18
19
  static void Write(Message* aMsg, const paramType& aParam)
20
0
  {
21
0
    WriteParam(aMsg, aParam.id);
22
0
    WriteParam(aMsg, aParam.value);
23
0
  }
24
25
  static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
26
0
  {
27
0
    int32_t id, value;
28
0
    if (ReadParam(aMsg, aIter, &id) &&
29
0
        ReadParam(aMsg, aIter, &value)) {
30
0
      aResult->id = id;
31
0
      aResult->value = value;
32
0
      return true;
33
0
    }
34
0
    return false;
35
0
  }
36
};
37
38
template<>
39
struct ParamTraits<nsTransparencyMode> : public ContiguousEnumSerializerInclusive<nsTransparencyMode, eTransparencyOpaque, eTransparencyBorderlessGlass>
40
{ };
41
42
template<>
43
struct ParamTraits<nsCursor>
44
  : public ContiguousEnumSerializer<nsCursor, eCursor_standard, eCursorCount>
45
{
46
};
47
48
} // namespace IPC
49
50
#endif // WidgetMessageUtils_h