Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PClientManagerOpChild.cpp
Line
Count
Source (jump to first uncovered line)
1
//
2
// Automatically generated by ipdlc.
3
// Edit at your own risk
4
//
5
6
7
#include "mozilla/dom/PClientManagerOpChild.h"
8
9
#include "mozilla/dom/PClientManagerChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
18
auto PClientManagerOpChild::Recv__delete__(const ClientOpResult& aResult) -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PClientManagerOpChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PClientManagerOpChild::PClientManagerOpChild() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PClientManagerOpChild);
32
0
}
33
34
PClientManagerOpChild::~PClientManagerOpChild()
35
0
{
36
0
    MOZ_COUNT_DTOR(PClientManagerOpChild);
37
0
}
38
39
auto PClientManagerOpChild::Manager() const -> PClientManagerChild*
40
0
{
41
0
    return static_cast<PClientManagerChild*>(IProtocol::Manager());
42
0
}
43
44
auto PClientManagerOpChild::RemoveManagee(
45
        int32_t aProtocolId,
46
        IProtocol* aListener) -> void
47
0
{
48
0
    FatalError("unreached");
49
0
    return;
50
0
}
51
52
auto PClientManagerOpChild::OnMessageReceived(const Message& msg__) -> PClientManagerOpChild::Result
53
0
{
54
0
    switch ((msg__).type()) {
55
0
    case PClientManagerOp::Msg___delete____ID:
56
0
        {
57
0
            if (mozilla::ipc::LoggingEnabledFor("PClientManagerOpChild")) {
58
0
                mozilla::ipc::LogMessageForProtocol("PClientManagerOpChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
59
0
            }
60
0
            AUTO_PROFILER_LABEL("PClientManagerOp::Msg___delete__", OTHER);
61
0
62
0
            PickleIterator iter__(msg__);
63
0
            PClientManagerOpChild* actor;
64
0
            ClientOpResult aResult;
65
0
66
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
67
0
                FatalError("Error deserializing 'PClientManagerOpChild'");
68
0
                return MsgValueError;
69
0
            }
70
0
            if ((!((*((&(actor))))))) {
71
0
                FatalError("Error deserializing 'PClientManagerOpChild'");
72
0
                return MsgValueError;
73
0
            }
74
0
            // Sentinel = 'actor'
75
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
76
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PClientManagerOpChild'");
77
0
                return MsgValueError;
78
0
            }
79
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aResult)))))) {
80
0
                FatalError("Error deserializing 'ClientOpResult'");
81
0
                return MsgValueError;
82
0
            }
83
0
            // Sentinel = 'aResult'
84
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3888726089)))) {
85
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ClientOpResult'");
86
0
                return MsgValueError;
87
0
            }
88
0
            (msg__).EndRead(iter__, (msg__).type());
89
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
90
0
                FatalError("Transition error");
91
0
                return MsgValueError;
92
0
            }
93
0
            if ((!(Recv__delete__(aResult)))) {
94
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
95
0
                // Error handled in mozilla::ipc::IPCResult
96
0
                return MsgProcessingError;
97
0
            }
98
0
99
0
100
0
            IProtocol* mgr = (actor)->Manager();
101
0
            (actor)->DestroySubtree(Deletion);
102
0
            (actor)->DeallocSubtree();
103
0
            (mgr)->RemoveManagee(PClientManagerOpMsgStart, actor);
104
0
105
0
            return MsgProcessed;
106
0
        }
107
0
    default:
108
0
        {
109
0
            return MsgNotKnown;
110
0
        }
111
0
    }
112
0
}
113
114
auto PClientManagerOpChild::OnMessageReceived(
115
        const Message& msg__,
116
        Message*& reply__) -> PClientManagerOpChild::Result
117
0
{
118
0
    return MsgNotKnown;
119
0
}
120
121
auto PClientManagerOpChild::OnCallReceived(
122
        const Message& msg__,
123
        Message*& reply__) -> PClientManagerOpChild::Result
124
0
{
125
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
126
0
    return MsgNotKnown;
127
0
}
128
129
auto PClientManagerOpChild::GetProtocolTypeId() -> int32_t
130
0
{
131
0
    return PClientManagerOpMsgStart;
132
0
}
133
134
auto PClientManagerOpChild::DestroySubtree(ActorDestroyReason why) -> void
135
0
{
136
0
    // Unregister from our manager.
137
0
    Unregister(Id());
138
0
139
0
    // Reject owning pending responses.
140
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
141
0
142
0
    // Finally, destroy "us".
143
0
    ActorDestroy(why);
144
0
}
145
146
auto PClientManagerOpChild::DeallocSubtree() -> void
147
0
{
148
0
}
149
150
151
152
} // namespace dom
153
} // namespace mozilla
154
namespace mozilla {
155
namespace ipc {
156
auto IPDLParamTraits<mozilla::dom::PClientManagerOpChild>::Write(
157
        IPC::Message* aMsg,
158
        mozilla::ipc::IProtocol* aActor,
159
        const paramType& aVar) -> void
160
0
{
161
0
    int32_t id;
162
0
    if ((!(aVar))) {
163
0
        id = 0;
164
0
    }
165
0
    else {
166
0
        id = (aVar)->Id();
167
0
        if ((1) == (id)) {
168
0
            (aActor)->FatalError("actor has been |delete|d");
169
0
        }
170
0
    }
171
0
    WriteIPDLParam(aMsg, aActor, id);
172
0
}
173
174
auto IPDLParamTraits<mozilla::dom::PClientManagerOpChild>::Read(
175
        const IPC::Message* aMsg,
176
        PickleIterator* aIter,
177
        mozilla::ipc::IProtocol* aActor,
178
        paramType* aVar) -> bool
179
0
{
180
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PClientManagerOp", PClientManagerOpMsgStart);
181
0
    if ((actor).isNothing()) {
182
0
        return false;
183
0
    }
184
0
185
0
    (*(aVar)) = static_cast<mozilla::dom::PClientManagerOpChild*>((actor).value());
186
0
    return true;
187
0
}
188
189
} // namespace ipc
190
} // namespace mozilla