Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PStreamNotifyChild.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/PStreamNotifyChild.h"
8
9
#include "mozilla/plugins/PPluginInstanceChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace plugins {
16
17
18
auto PStreamNotifyChild::Recv__delete__(const NPReason& reason) -> mozilla::ipc::IPCResult
19
0
{
20
0
    return IPC_OK();
21
0
}
22
23
auto PStreamNotifyChild::ActorDestroy(ActorDestroyReason aWhy) -> void
24
0
{
25
0
}
26
27
MOZ_IMPLICIT PStreamNotifyChild::PStreamNotifyChild() :
28
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
29
    mLivenessState(mozilla::ipc::LivenessState::Dead)
30
0
{
31
0
    MOZ_COUNT_CTOR(PStreamNotifyChild);
32
0
}
33
34
PStreamNotifyChild::~PStreamNotifyChild()
35
0
{
36
0
    MOZ_COUNT_DTOR(PStreamNotifyChild);
37
0
}
38
39
auto PStreamNotifyChild::Manager() const -> PPluginInstanceChild*
40
0
{
41
0
    return static_cast<PPluginInstanceChild*>(IProtocol::Manager());
42
0
}
43
44
auto PStreamNotifyChild::SendRedirectNotifyResponse(const bool& allow) -> bool
45
0
{
46
0
    IPC::Message* msg__ = PStreamNotify::Msg_RedirectNotifyResponse(Id());
47
0
48
0
    WriteIPDLParam(msg__, this, allow);
49
0
    // Sentinel = 'allow'
50
0
    (msg__)->WriteSentinel(3737033206);
51
0
52
0
53
0
54
0
55
0
    if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyChild")) {
56
0
        mozilla::ipc::LogMessageForProtocol("PStreamNotifyChild", OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
57
0
    }
58
0
    AUTO_PROFILER_LABEL("PStreamNotify::Msg_RedirectNotifyResponse", 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 PStreamNotifyChild::RemoveManagee(
68
        int32_t aProtocolId,
69
        IProtocol* aListener) -> void
70
0
{
71
0
    FatalError("unreached");
72
0
    return;
73
0
}
74
75
auto PStreamNotifyChild::OnMessageReceived(const Message& msg__) -> PStreamNotifyChild::Result
76
0
{
77
0
    switch ((msg__).type()) {
78
0
    case PStreamNotify::Msg_RedirectNotify__ID:
79
0
        {
80
0
            if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyChild")) {
81
0
                mozilla::ipc::LogMessageForProtocol("PStreamNotifyChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
82
0
            }
83
0
            AUTO_PROFILER_LABEL("PStreamNotify::Msg_RedirectNotify", OTHER);
84
0
85
0
            PickleIterator iter__(msg__);
86
0
            nsCString url;
87
0
            int32_t status;
88
0
89
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(url)))))) {
90
0
                FatalError("Error deserializing 'nsCString'");
91
0
                return MsgValueError;
92
0
            }
93
0
            // Sentinel = 'url'
94
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1453210600)))) {
95
0
                mozilla::ipc::SentinelReadError("Error deserializing 'nsCString'");
96
0
                return MsgValueError;
97
0
            }
98
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(status)))))) {
99
0
                FatalError("Error deserializing 'int32_t'");
100
0
                return MsgValueError;
101
0
            }
102
0
            // Sentinel = 'status'
103
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3714608576)))) {
104
0
                mozilla::ipc::SentinelReadError("Error deserializing 'int32_t'");
105
0
                return MsgValueError;
106
0
            }
107
0
            (msg__).EndRead(iter__, (msg__).type());
108
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
109
0
                FatalError("Transition error");
110
0
                return MsgValueError;
111
0
            }
112
0
            if ((!(RecvRedirectNotify(url, status)))) {
113
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
114
0
                // Error handled in mozilla::ipc::IPCResult
115
0
                return MsgProcessingError;
116
0
            }
117
0
118
0
            return MsgProcessed;
119
0
        }
120
0
    case PStreamNotify::Msg___delete____ID:
121
0
        {
122
0
            if (mozilla::ipc::LoggingEnabledFor("PStreamNotifyChild")) {
123
0
                mozilla::ipc::LogMessageForProtocol("PStreamNotifyChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
124
0
            }
125
0
            AUTO_PROFILER_LABEL("PStreamNotify::Msg___delete__", OTHER);
126
0
127
0
            PickleIterator iter__(msg__);
128
0
            PStreamNotifyChild* actor;
129
0
            NPReason reason;
130
0
131
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
132
0
                FatalError("Error deserializing 'PStreamNotifyChild'");
133
0
                return MsgValueError;
134
0
            }
135
0
            if ((!((*((&(actor))))))) {
136
0
                FatalError("Error deserializing 'PStreamNotifyChild'");
137
0
                return MsgValueError;
138
0
            }
139
0
            // Sentinel = 'actor'
140
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
141
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PStreamNotifyChild'");
142
0
                return MsgValueError;
143
0
            }
144
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(reason)))))) {
145
0
                FatalError("Error deserializing 'NPReason'");
146
0
                return MsgValueError;
147
0
            }
148
0
            // Sentinel = 'reason'
149
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 4151390930)))) {
150
0
                mozilla::ipc::SentinelReadError("Error deserializing 'NPReason'");
151
0
                return MsgValueError;
152
0
            }
153
0
            (msg__).EndRead(iter__, (msg__).type());
154
0
            if ((!(StateTransition(true, (&(mLivenessState)))))) {
155
0
                FatalError("Transition error");
156
0
                return MsgValueError;
157
0
            }
158
0
            if ((!(Recv__delete__(reason)))) {
159
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
160
0
                // Error handled in mozilla::ipc::IPCResult
161
0
                return MsgProcessingError;
162
0
            }
163
0
164
0
165
0
            IProtocol* mgr = (actor)->Manager();
166
0
            (actor)->DestroySubtree(Deletion);
167
0
            (actor)->DeallocSubtree();
168
0
            (mgr)->RemoveManagee(PStreamNotifyMsgStart, actor);
169
0
170
0
            return MsgProcessed;
171
0
        }
172
0
    default:
173
0
        {
174
0
            return MsgNotKnown;
175
0
        }
176
0
    }
177
0
}
178
179
auto PStreamNotifyChild::OnMessageReceived(
180
        const Message& msg__,
181
        Message*& reply__) -> PStreamNotifyChild::Result
182
0
{
183
0
    return MsgNotKnown;
184
0
}
185
186
auto PStreamNotifyChild::OnCallReceived(
187
        const Message& msg__,
188
        Message*& reply__) -> PStreamNotifyChild::Result
189
0
{
190
0
    return MsgNotKnown;
191
0
}
192
193
auto PStreamNotifyChild::GetProtocolTypeId() -> int32_t
194
0
{
195
0
    return PStreamNotifyMsgStart;
196
0
}
197
198
auto PStreamNotifyChild::DestroySubtree(ActorDestroyReason why) -> void
199
0
{
200
0
    // Unregister from our manager.
201
0
    Unregister(Id());
202
0
203
0
    // Reject owning pending responses.
204
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
205
0
206
0
    // Finally, destroy "us".
207
0
    ActorDestroy(why);
208
0
}
209
210
auto PStreamNotifyChild::DeallocSubtree() -> void
211
0
{
212
0
}
213
214
215
216
} // namespace plugins
217
} // namespace mozilla
218
namespace mozilla {
219
namespace ipc {
220
auto IPDLParamTraits<mozilla::plugins::PStreamNotifyChild>::Write(
221
        IPC::Message* aMsg,
222
        mozilla::ipc::IProtocol* aActor,
223
        const paramType& aVar) -> void
224
0
{
225
0
    int32_t id;
226
0
    if ((!(aVar))) {
227
0
        id = 0;
228
0
    }
229
0
    else {
230
0
        id = (aVar)->Id();
231
0
        if ((1) == (id)) {
232
0
            (aActor)->FatalError("actor has been |delete|d");
233
0
        }
234
0
    }
235
0
    WriteIPDLParam(aMsg, aActor, id);
236
0
}
237
238
auto IPDLParamTraits<mozilla::plugins::PStreamNotifyChild>::Read(
239
        const IPC::Message* aMsg,
240
        PickleIterator* aIter,
241
        mozilla::ipc::IProtocol* aActor,
242
        paramType* aVar) -> bool
243
0
{
244
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PStreamNotify", PStreamNotifyMsgStart);
245
0
    if ((actor).isNothing()) {
246
0
        return false;
247
0
    }
248
0
249
0
    (*(aVar)) = static_cast<mozilla::plugins::PStreamNotifyChild*>((actor).value());
250
0
    return true;
251
0
}
252
253
} // namespace ipc
254
} // namespace mozilla