Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PPluginWidgetChild.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/plugins/PPluginWidgetChild.h"
8
9
#include "mozilla/dom/PBrowserChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace plugins {
16
17
18
auto PPluginWidgetChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19
0
{
20
0
}
21
22
MOZ_IMPLICIT PPluginWidgetChild::PPluginWidgetChild() :
23
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24
    mLivenessState(mozilla::ipc::LivenessState::Dead)
25
0
{
26
0
    MOZ_COUNT_CTOR(PPluginWidgetChild);
27
0
}
28
29
PPluginWidgetChild::~PPluginWidgetChild()
30
0
{
31
0
    MOZ_COUNT_DTOR(PPluginWidgetChild);
32
0
}
33
34
auto PPluginWidgetChild::Manager() const -> PBrowserChild*
35
0
{
36
0
    return static_cast<PBrowserChild*>(IProtocol::Manager());
37
0
}
38
39
auto PPluginWidgetChild::Send__delete__(PPluginWidgetChild* actor) -> bool
40
0
{
41
0
    if ((!(actor))) {
42
0
        return false;
43
0
    }
44
0
45
0
    IPC::Message* msg__ = PPluginWidget::Msg___delete__((actor)->Id());
46
0
47
0
    MOZ_RELEASE_ASSERT(actor, "NULL actor value passed to non-nullable param");
48
0
    WriteIPDLParam(msg__, actor, actor);
49
0
    // Sentinel = 'actor'
50
0
    (msg__)->WriteSentinel(875202478);
51
0
52
0
53
0
54
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
55
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
56
0
    }
57
0
    AUTO_PROFILER_LABEL("PPluginWidget::Msg___delete__", OTHER);
58
0
    if ((!(StateTransition(true, (&((actor)->mLivenessState)))))) {
59
0
        mozilla::ipc::LogicError("Transition error");
60
0
    }
61
0
62
0
    bool sendok__ = ((actor)->GetIPCChannel())->Send(msg__);
63
0
64
0
    IProtocol* mgr = (actor)->Manager();
65
0
    (actor)->DestroySubtree(Deletion);
66
0
    (actor)->DeallocSubtree();
67
0
    (mgr)->RemoveManagee(PPluginWidgetMsgStart, actor);
68
0
    return sendok__;
69
0
}
70
71
auto PPluginWidgetChild::SendCreate(
72
        nsresult* aResult,
73
        uint64_t* aScrollCaptureId,
74
        uintptr_t* aPluginInstanceId) -> bool
75
0
{
76
0
    IPC::Message* msg__ = PPluginWidget::Msg_Create(Id());
77
0
78
0
79
0
80
0
81
0
    Message reply__;
82
0
83
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
84
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
85
0
    }
86
0
    AUTO_PROFILER_LABEL("PPluginWidget::Msg_Create", OTHER);
87
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
88
0
        mozilla::ipc::LogicError("Transition error");
89
0
    }
90
0
91
0
    bool sendok__;
92
0
    {
93
0
        AUTO_PROFILER_TRACING("IPC", "PPluginWidget::Msg_Create");
94
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
95
0
    }
96
0
    if ((!(sendok__))) {
97
0
        return false;
98
0
    }
99
0
100
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
101
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
102
0
    }
103
0
104
0
    PickleIterator iter__(reply__);
105
0
106
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aResult)))) {
107
0
        FatalError("Error deserializing 'nsresult'");
108
0
        return false;
109
0
    }
110
0
    // Sentinel = 'aResult'
111
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3888726089)))) {
112
0
        mozilla::ipc::SentinelReadError("Error deserializing 'nsresult'");
113
0
        return false;
114
0
    }
115
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aScrollCaptureId)))) {
116
0
        FatalError("Error deserializing 'uint64_t'");
117
0
        return false;
118
0
    }
119
0
    // Sentinel = 'aScrollCaptureId'
120
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3492685879)))) {
121
0
        mozilla::ipc::SentinelReadError("Error deserializing 'uint64_t'");
122
0
        return false;
123
0
    }
124
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, aPluginInstanceId)))) {
125
0
        FatalError("Error deserializing 'uintptr_t'");
126
0
        return false;
127
0
    }
128
0
    // Sentinel = 'aPluginInstanceId'
129
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 2621152699)))) {
130
0
        mozilla::ipc::SentinelReadError("Error deserializing 'uintptr_t'");
131
0
        return false;
132
0
    }
133
0
    (reply__).EndRead(iter__, (reply__).type());
134
0
135
0
    return true;
136
0
}
137
138
auto PPluginWidgetChild::SendSetFocus(const bool& aRaise) -> bool
139
0
{
140
0
    IPC::Message* msg__ = PPluginWidget::Msg_SetFocus(Id());
141
0
142
0
    WriteIPDLParam(msg__, this, aRaise);
143
0
    // Sentinel = 'aRaise'
144
0
    (msg__)->WriteSentinel(902411529);
145
0
146
0
147
0
148
0
149
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
150
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
151
0
    }
152
0
    AUTO_PROFILER_LABEL("PPluginWidget::Msg_SetFocus", OTHER);
153
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
154
0
        mozilla::ipc::LogicError("Transition error");
155
0
    }
156
0
157
0
    bool sendok__ = (GetIPCChannel())->Send(msg__);
158
0
    return sendok__;
159
0
}
160
161
auto PPluginWidgetChild::SendGetNativePluginPort(uintptr_t* value) -> bool
162
0
{
163
0
    IPC::Message* msg__ = PPluginWidget::Msg_GetNativePluginPort(Id());
164
0
165
0
166
0
167
0
168
0
    Message reply__;
169
0
170
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
171
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
172
0
    }
173
0
    AUTO_PROFILER_LABEL("PPluginWidget::Msg_GetNativePluginPort", OTHER);
174
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
175
0
        mozilla::ipc::LogicError("Transition error");
176
0
    }
177
0
178
0
    bool sendok__;
179
0
    {
180
0
        AUTO_PROFILER_TRACING("IPC", "PPluginWidget::Msg_GetNativePluginPort");
181
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
182
0
    }
183
0
    if ((!(sendok__))) {
184
0
        return false;
185
0
    }
186
0
187
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
188
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
189
0
    }
190
0
191
0
    PickleIterator iter__(reply__);
192
0
193
0
    if ((!(ReadIPDLParam((&(reply__)), (&(iter__)), this, value)))) {
194
0
        FatalError("Error deserializing 'uintptr_t'");
195
0
        return false;
196
0
    }
197
0
    // Sentinel = 'value'
198
0
    if ((!(((&(reply__)))->ReadSentinel((&(iter__)), 3456818542)))) {
199
0
        mozilla::ipc::SentinelReadError("Error deserializing 'uintptr_t'");
200
0
        return false;
201
0
    }
202
0
    (reply__).EndRead(iter__, (reply__).type());
203
0
204
0
    return true;
205
0
}
206
207
auto PPluginWidgetChild::SendSetNativeChildWindow(const uintptr_t& childWindow) -> bool
208
0
{
209
0
    IPC::Message* msg__ = PPluginWidget::Msg_SetNativeChildWindow(Id());
210
0
211
0
    WriteIPDLParam(msg__, this, childWindow);
212
0
    // Sentinel = 'childWindow'
213
0
    (msg__)->WriteSentinel(2307824933);
214
0
215
0
216
0
217
0
    Message reply__;
218
0
219
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
220
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
221
0
    }
222
0
    AUTO_PROFILER_LABEL("PPluginWidget::Msg_SetNativeChildWindow", OTHER);
223
0
    if ((!(StateTransition(false, (&(mLivenessState)))))) {
224
0
        mozilla::ipc::LogicError("Transition error");
225
0
    }
226
0
227
0
    bool sendok__;
228
0
    {
229
0
        AUTO_PROFILER_TRACING("IPC", "PPluginWidget::Msg_SetNativeChildWindow");
230
0
        sendok__ = (GetIPCChannel())->Send(msg__, (&(reply__)));
231
0
    }
232
0
    if ((!(sendok__))) {
233
0
        return false;
234
0
    }
235
0
236
0
    if (mozilla::ipc::LoggingEnabledFor("PPluginWidgetChild")) {
237
0
        mozilla::ipc::LogMessageForProtocol("PPluginWidgetChild", OtherPid(), "Received reply ", ((&(reply__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
238
0
    }
239
0
240
0
    return true;
241
0
}
242
243
auto PPluginWidgetChild::RemoveManagee(
244
        int32_t aProtocolId,
245
        IProtocol* aListener) -> void
246
0
{
247
0
    FatalError("unreached");
248
0
    return;
249
0
}
250
251
auto PPluginWidgetChild::OnMessageReceived(const Message& msg__) -> PPluginWidgetChild::Result
252
{
253
    switch ((msg__).type()) {
254
    case PPluginWidget::Reply___delete____ID:
255
        {
256
            return MsgProcessed;
257
        }
258
    default:
259
        {
260
            return MsgNotKnown;
261
        }
262
    }
263
}
264
265
auto PPluginWidgetChild::OnMessageReceived(
266
        const Message& msg__,
267
        Message*& reply__) -> PPluginWidgetChild::Result
268
0
{
269
0
    return MsgNotKnown;
270
0
}
271
272
auto PPluginWidgetChild::OnCallReceived(
273
        const Message& msg__,
274
        Message*& reply__) -> PPluginWidgetChild::Result
275
0
{
276
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
277
0
    return MsgNotKnown;
278
0
}
279
280
auto PPluginWidgetChild::GetProtocolTypeId() -> int32_t
281
0
{
282
0
    return PPluginWidgetMsgStart;
283
0
}
284
285
auto PPluginWidgetChild::DestroySubtree(ActorDestroyReason why) -> void
286
0
{
287
0
    // Unregister from our manager.
288
0
    Unregister(Id());
289
0
290
0
    // Reject owning pending responses.
291
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
292
0
293
0
    // Finally, destroy "us".
294
0
    ActorDestroy(why);
295
0
}
296
297
auto PPluginWidgetChild::DeallocSubtree() -> void
298
0
{
299
0
}
300
301
302
303
} // namespace plugins
304
} // namespace mozilla
305
namespace mozilla {
306
namespace ipc {
307
auto IPDLParamTraits<mozilla::plugins::PPluginWidgetChild>::Write(
308
        IPC::Message* aMsg,
309
        mozilla::ipc::IProtocol* aActor,
310
        const paramType& aVar) -> void
311
0
{
312
0
    int32_t id;
313
0
    if ((!(aVar))) {
314
0
        id = 0;
315
0
    }
316
0
    else {
317
0
        id = (aVar)->Id();
318
0
        if ((1) == (id)) {
319
0
            (aActor)->FatalError("actor has been |delete|d");
320
0
        }
321
0
    }
322
0
    WriteIPDLParam(aMsg, aActor, id);
323
0
}
324
325
auto IPDLParamTraits<mozilla::plugins::PPluginWidgetChild>::Read(
326
        const IPC::Message* aMsg,
327
        PickleIterator* aIter,
328
        mozilla::ipc::IProtocol* aActor,
329
        paramType* aVar) -> bool
330
0
{
331
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PPluginWidget", PPluginWidgetMsgStart);
332
0
    if ((actor).isNothing()) {
333
0
        return false;
334
0
    }
335
0
336
0
    (*(aVar)) = static_cast<mozilla::plugins::PPluginWidgetChild*>((actor).value());
337
0
    return true;
338
0
}
339
340
} // namespace ipc
341
} // namespace mozilla