Coverage Report

Created: 2018-09-25 14:53

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