Coverage Report

Created: 2018-09-25 14:53

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