Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PFileDescriptorSetChild.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/ipc/PFileDescriptorSetChild.h"
8
9
#include "mozilla/ipc/PBackgroundChild.h"
10
#include "mozilla/dom/PContentChild.h"
11
#include "mozilla/dom/PContentBridgeChild.h"
12
13
#include "nsIFile.h"
14
#include "GeckoProfiler.h"
15
16
namespace mozilla {
17
namespace ipc {
18
19
20
auto PFileDescriptorSetChild::Recv__delete__() -> mozilla::ipc::IPCResult
21
0
{
22
0
    return IPC_OK();
23
0
}
24
25
auto PFileDescriptorSetChild::ActorDestroy(ActorDestroyReason aWhy) -> void
26
0
{
27
0
}
28
29
MOZ_IMPLICIT PFileDescriptorSetChild::PFileDescriptorSetChild() :
30
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
31
    mLivenessState(mozilla::ipc::LivenessState::Dead)
32
0
{
33
0
    MOZ_COUNT_CTOR(PFileDescriptorSetChild);
34
0
}
35
36
PFileDescriptorSetChild::~PFileDescriptorSetChild()
37
0
{
38
0
    MOZ_COUNT_DTOR(PFileDescriptorSetChild);
39
0
}
40
41
auto PFileDescriptorSetChild::SendAddFileDescriptor(const FileDescriptor& fd) -> bool
42
0
{
43
0
    IPC::Message* msg__ = PFileDescriptorSet::Msg_AddFileDescriptor(Id());
44
0
45
0
    WriteIPDLParam(msg__, this, fd);
46
0
    // Sentinel = 'fd'
47
0
    (msg__)->WriteSentinel(628535764);
48
0
49
0
50
0
51
0
52
0
    if (mozilla::ipc::LoggingEnabledFor("PFileDescriptorSetChild")) {
53
0
        mozilla::ipc::LogMessageForProtocol("PFileDescriptorSetChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
54
0
    }
55
0
    AUTO_PROFILER_LABEL("PFileDescriptorSet::Msg_AddFileDescriptor", OTHER);
56
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
57
0
        mozilla::ipc::LogicError("Transition error");
58
0
    }
59
0
60
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
61
0
    return sendok__;
62
0
}
63
64
auto PFileDescriptorSetChild::Send__delete__(PFileDescriptorSetChild* actor) -> bool
65
0
{
66
0
    if ((!(actor))) {
67
0
        return false;
68
0
    }
69
0
70
0
    IPC::Message* msg__ = PFileDescriptorSet::Msg___delete__((actor)->Id());
71
0
72
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
73
0
    WriteIPDLParam(msg__, actor, actor);
74
0
    // Sentinel = 'actor'
75
0
    (msg__)->WriteSentinel(875202478);
76
0
77
0
78
0
79
0
    if (mozilla::ipc::LoggingEnabledFor("PFileDescriptorSetChild")) {
80
0
        mozilla::ipc::LogMessageForProtocol("PFileDescriptorSetChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
81
0
    }
82
0
    AUTO_PROFILER_LABEL("PFileDescriptorSet::Msg___delete__", OTHER);
83
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
84
0
        mozilla::ipc::LogicError("Transition error");
85
0
    }
86
0
87
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
88
0
89
0
    IProtocol* mgr = (actor)->Manager();
90
0
    (actor)->DestroySubtree(Deletion);
91
0
    (actor)->DeallocSubtree();
92
0
    (mgr)->RemoveManagee(PFileDescriptorSetMsgStart, actor);
93
0
    return sendok__;
94
0
}
95
96
auto PFileDescriptorSetChild::RemoveManagee(
97
        int32_t aProtocolId,
98
        IProtocol* aListener) -> void
99
0
{
100
0
    FatalError("unreached");
101
0
    return;
102
0
}
103
104
auto PFileDescriptorSetChild::OnMessageReceived(const Message& msg__) -> PFileDescriptorSetChild::Result
105
0
{
106
0
    switch ((msg__).type()) {
107
0
    case PFileDescriptorSet::Msg_AddFileDescriptor__ID:
108
0
        {
109
0
            if (mozilla::ipc::LoggingEnabledFor("PFileDescriptorSetChild")) {
110
0
                mozilla::ipc::LogMessageForProtocol("PFileDescriptorSetChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
111
0
            }
112
0
            AUTO_PROFILER_LABEL("PFileDescriptorSet::Msg_AddFileDescriptor", OTHER);
113
0
114
0
            PickleIterator iter__(msg__);
115
0
            FileDescriptor fd;
116
0
117
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(fd)))))) {
118
0
                FatalError("Error deserializing 'FileDescriptor'");
119
0
                return MsgValueError;
120
0
            }
121
0
            // Sentinel = 'fd'
122
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 628535764)))) {
123
0
                mozilla::ipc::SentinelReadError("Error deserializing 'FileDescriptor'");
124
0
                return MsgValueError;
125
0
            }
126
0
            (msg__).EndRead(iter__, (msg__).type());
127
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
128
0
                FatalError("Transition error");
129
0
                return MsgValueError;
130
0
            }
131
0
            if ((!(RecvAddFileDescriptor(fd)))) {
132
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
133
0
                // Error handled in mozilla::ipc::IPCResult
134
0
                return MsgProcessingError;
135
0
            }
136
0
137
0
            return MsgProcessed;
138
0
        }
139
0
    case PFileDescriptorSet::Reply___delete____ID:
140
0
        {
141
0
            return MsgProcessed;
142
0
        }
143
0
    case PFileDescriptorSet::Msg___delete____ID:
144
0
        {
145
0
            if (mozilla::ipc::LoggingEnabledFor("PFileDescriptorSetChild")) {
146
0
                mozilla::ipc::LogMessageForProtocol("PFileDescriptorSetChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
147
0
            }
148
0
            AUTO_PROFILER_LABEL("PFileDescriptorSet::Msg___delete__", OTHER);
149
0
150
0
            PickleIterator iter__(msg__);
151
0
            PFileDescriptorSetChild* actor;
152
0
153
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
154
0
                FatalError("Error deserializing 'PFileDescriptorSetChild'");
155
0
                return MsgValueError;
156
0
            }
157
0
            if ((!((*((&(actor))))))) {
158
0
                FatalError("Error deserializing 'PFileDescriptorSetChild'");
159
0
                return MsgValueError;
160
0
            }
161
0
            // Sentinel = 'actor'
162
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
163
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PFileDescriptorSetChild'");
164
0
                return MsgValueError;
165
0
            }
166
0
            (msg__).EndRead(iter__, (msg__).type());
167
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
168
0
                FatalError("Transition error");
169
0
                return MsgValueError;
170
0
            }
171
0
            if ((!(Recv__delete__()))) {
172
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
173
0
                // Error handled in mozilla::ipc::IPCResult
174
0
                return MsgProcessingError;
175
0
            }
176
0
177
0
178
0
            IProtocol* mgr = (actor)->Manager();
179
0
            (actor)->DestroySubtree(Deletion);
180
0
            (actor)->DeallocSubtree();
181
0
            (mgr)->RemoveManagee(PFileDescriptorSetMsgStart, actor);
182
0
183
0
            return MsgProcessed;
184
0
        }
185
0
    default:
186
0
        {
187
0
            return MsgNotKnown;
188
0
        }
189
0
    }
190
0
}
191
192
auto PFileDescriptorSetChild::OnMessageReceived(
193
        const Message& msg__,
194
        Message*& reply__) -> PFileDescriptorSetChild::Result
195
0
{
196
0
    return MsgNotKnown;
197
0
}
198
199
auto PFileDescriptorSetChild::OnCallReceived(
200
        const Message& msg__,
201
        Message*& reply__) -> PFileDescriptorSetChild::Result
202
0
{
203
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
204
0
    return MsgNotKnown;
205
0
}
206
207
auto PFileDescriptorSetChild::GetProtocolTypeId() -> int32_t
208
0
{
209
0
    return PFileDescriptorSetMsgStart;
210
0
}
211
212
auto PFileDescriptorSetChild::DestroySubtree(ActorDestroyReason why) -> void
213
0
{
214
0
    // Unregister from our manager.
215
0
    Unregister(Id());
216
0
217
0
    // Reject owning pending responses.
218
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
219
0
220
0
    // Finally, destroy "us".
221
0
    ActorDestroy(why);
222
0
}
223
224
auto PFileDescriptorSetChild::DeallocSubtree() -> void
225
0
{
226
0
}
227
228
229
230
} // namespace ipc
231
} // namespace mozilla
232
namespace mozilla {
233
namespace ipc {
234
auto IPDLParamTraits<mozilla::ipc::PFileDescriptorSetChild>::Write(
235
        IPC::Message* aMsg,
236
        mozilla::ipc::IProtocol* aActor,
237
        const paramType& aVar) -> void
238
0
{
239
0
    int32_t id;
240
0
    if ((!(aVar))) {
241
0
        id = 0;
242
0
    }
243
0
    else {
244
0
        id = (aVar)->Id();
245
0
        if ((1) == (id)) {
246
0
            (aActor)->FatalError("actor has been |delete|d");
247
0
        }
248
0
    }
249
0
    WriteIPDLParam(aMsg, aActor, id);
250
0
}
251
252
auto IPDLParamTraits<mozilla::ipc::PFileDescriptorSetChild>::Read(
253
        const IPC::Message* aMsg,
254
        PickleIterator* aIter,
255
        mozilla::ipc::IProtocol* aActor,
256
        paramType* aVar) -> bool
257
0
{
258
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PFileDescriptorSet", PFileDescriptorSetMsgStart);
259
0
    if ((actor).isNothing()) {
260
0
        return false;
261
0
    }
262
0
263
0
    (*(aVar)) = static_cast<mozilla::ipc::PFileDescriptorSetChild*>((actor).value());
264
0
    return true;
265
0
}
266
267
} // namespace ipc
268
} // namespace mozilla