Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/TabMessageUtils.h
Line
Count
Source (jump to first uncovered line)
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 TABMESSAGE_UTILS_H
8
#define TABMESSAGE_UTILS_H
9
10
#include "ipc/IPCMessageUtils.h"
11
#include "mozilla/RefPtr.h"
12
#include "mozilla/dom/Event.h"
13
#include "nsExceptionHandler.h"
14
#include "nsPIDOMWindow.h"
15
#include "nsCOMPtr.h"
16
17
namespace mozilla {
18
namespace dom {
19
class Event;
20
21
struct RemoteDOMEvent
22
{
23
  // Make sure to set the owner after deserializing.
24
  RefPtr<Event> mEvent;
25
};
26
27
bool ReadRemoteEvent(const IPC::Message* aMsg, PickleIterator* aIter,
28
                     mozilla::dom::RemoteDOMEvent* aResult);
29
30
typedef CrashReporter::ThreadId NativeThreadId;
31
32
} // namespace dom
33
} // namespace mozilla
34
35
namespace IPC {
36
37
template<>
38
struct ParamTraits<mozilla::dom::RemoteDOMEvent>
39
{
40
  typedef mozilla::dom::RemoteDOMEvent paramType;
41
42
  static void Write(Message* aMsg, const paramType& aParam)
43
0
  {
44
0
    aParam.mEvent->Serialize(aMsg, true);
45
0
  }
46
47
  static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
48
0
  {
49
0
    return mozilla::dom::ReadRemoteEvent(aMsg, aIter, aResult);
50
0
  }
51
52
  static void Log(const paramType& aParam, std::wstring* aLog)
53
0
  {
54
0
  }
55
};
56
57
template <>
58
struct ParamTraits<nsEventStatus>
59
  : public ContiguousEnumSerializer<nsEventStatus,
60
                                    nsEventStatus_eIgnore,
61
                                    nsEventStatus_eSentinel>
62
{};
63
64
template<>
65
struct ParamTraits<nsSizeMode>
66
  : public ContiguousEnumSerializer<nsSizeMode,
67
                                    nsSizeMode_Normal,
68
                                    nsSizeMode_Invalid>
69
{};
70
71
template<>
72
struct ParamTraits<UIStateChangeType>
73
  : public ContiguousEnumSerializer<UIStateChangeType,
74
                                    UIStateChangeType_NoChange,
75
                                    UIStateChangeType_Invalid>
76
{ };
77
78
} // namespace IPC
79
80
#endif // TABMESSAGE_UTILS_H