Coverage Report

Created: 2018-09-25 14:53

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