Coverage Report

Created: 2018-09-25 14:53

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