Coverage Report

Created: 2018-09-25 14:53

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