Coverage Report

Created: 2018-09-25 14:53

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