Coverage Report

Created: 2018-09-25 14:53

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