Coverage Report

Created: 2018-09-25 14:53

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