Coverage Report

Created: 2018-09-25 14:53

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