Coverage Report

Created: 2018-09-25 14:53

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