Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PServiceWorkerUpdaterChild.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/PServiceWorkerUpdaterChild.h"
8
9
#include "mozilla/dom/PServiceWorkerManagerChild.h"
10
11
#include "nsIFile.h"
12
#include "GeckoProfiler.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
18
auto PServiceWorkerUpdaterChild::ActorDestroy(ActorDestroyReason aWhy) -> void
19
0
{
20
0
}
21
22
MOZ_IMPLICIT PServiceWorkerUpdaterChild::PServiceWorkerUpdaterChild() :
23
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
24
    mLivenessState(mozilla::ipc::LivenessState::Dead)
25
0
{
26
0
    MOZ_COUNT_CTOR(PServiceWorkerUpdaterChild);
27
0
}
28
29
PServiceWorkerUpdaterChild::~PServiceWorkerUpdaterChild()
30
0
{
31
0
    MOZ_COUNT_DTOR(PServiceWorkerUpdaterChild);
32
0
}
33
34
auto PServiceWorkerUpdaterChild::Manager() const -> PServiceWorkerManagerChild*
35
0
{
36
0
    return static_cast<PServiceWorkerManagerChild*>(IProtocol::Manager());
37
0
}
38
39
auto PServiceWorkerUpdaterChild::Send__delete__(PServiceWorkerUpdaterChild* actor) -> bool
40
0
{
41
0
    if ((!(actor))) {
42
0
        return false;
43
0
    }
44
0
45
0
    IPC::Message* msg__ = PServiceWorkerUpdater::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("PServiceWorkerUpdaterChild")) {
55
0
        mozilla::ipc::LogMessageForProtocol("PServiceWorkerUpdaterChild", (actor)->OtherPid(), "Sending ", (msg__)->type(), mozilla::ipc::MessageDirection::eSending);
56
0
    }
57
0
    AUTO_PROFILER_LABEL("PServiceWorkerUpdater::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(PServiceWorkerUpdaterMsgStart, actor);
68
0
    return sendok__;
69
0
}
70
71
auto PServiceWorkerUpdaterChild::RemoveManagee(
72
        int32_t aProtocolId,
73
        IProtocol* aListener) -> void
74
0
{
75
0
    FatalError("unreached");
76
0
    return;
77
0
}
78
79
auto PServiceWorkerUpdaterChild::OnMessageReceived(const Message& msg__) -> PServiceWorkerUpdaterChild::Result
80
0
{
81
0
    switch ((msg__).type()) {
82
0
    case PServiceWorkerUpdater::Reply___delete____ID:
83
0
        {
84
0
            return MsgProcessed;
85
0
        }
86
0
    case PServiceWorkerUpdater::Msg_Proceed__ID:
87
0
        {
88
0
            if (mozilla::ipc::LoggingEnabledFor("PServiceWorkerUpdaterChild")) {
89
0
                mozilla::ipc::LogMessageForProtocol("PServiceWorkerUpdaterChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
90
0
            }
91
0
            AUTO_PROFILER_LABEL("PServiceWorkerUpdater::Msg_Proceed", OTHER);
92
0
93
0
            PickleIterator iter__(msg__);
94
0
            bool allowed;
95
0
96
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(allowed)))))) {
97
0
                FatalError("Error deserializing 'bool'");
98
0
                return MsgValueError;
99
0
            }
100
0
            // Sentinel = 'allowed'
101
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 1297156503)))) {
102
0
                mozilla::ipc::SentinelReadError("Error deserializing 'bool'");
103
0
                return MsgValueError;
104
0
            }
105
0
            (msg__).EndRead(iter__, (msg__).type());
106
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
107
0
                FatalError("Transition error");
108
0
                return MsgValueError;
109
0
            }
110
0
            if ((!(RecvProceed(allowed)))) {
111
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
112
0
                // Error handled in mozilla::ipc::IPCResult
113
0
                return MsgProcessingError;
114
0
            }
115
0
116
0
            return MsgProcessed;
117
0
        }
118
0
    default:
119
0
        {
120
0
            return MsgNotKnown;
121
0
        }
122
0
    }
123
0
}
124
125
auto PServiceWorkerUpdaterChild::OnMessageReceived(
126
        const Message& msg__,
127
        Message*& reply__) -> PServiceWorkerUpdaterChild::Result
128
0
{
129
0
    return MsgNotKnown;
130
0
}
131
132
auto PServiceWorkerUpdaterChild::OnCallReceived(
133
        const Message& msg__,
134
        Message*& reply__) -> PServiceWorkerUpdaterChild::Result
135
0
{
136
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
137
0
    return MsgNotKnown;
138
0
}
139
140
auto PServiceWorkerUpdaterChild::GetProtocolTypeId() -> int32_t
141
0
{
142
0
    return PServiceWorkerUpdaterMsgStart;
143
0
}
144
145
auto PServiceWorkerUpdaterChild::DestroySubtree(ActorDestroyReason why) -> void
146
0
{
147
0
    // Unregister from our manager.
148
0
    Unregister(Id());
149
0
150
0
    // Reject owning pending responses.
151
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
152
0
153
0
    // Finally, destroy "us".
154
0
    ActorDestroy(why);
155
0
}
156
157
auto PServiceWorkerUpdaterChild::DeallocSubtree() -> void
158
0
{
159
0
}
160
161
162
163
} // namespace dom
164
} // namespace mozilla
165
namespace mozilla {
166
namespace ipc {
167
auto IPDLParamTraits<mozilla::dom::PServiceWorkerUpdaterChild>::Write(
168
        IPC::Message* aMsg,
169
        mozilla::ipc::IProtocol* aActor,
170
        const paramType& aVar) -> void
171
0
{
172
0
    int32_t id;
173
0
    if ((!(aVar))) {
174
0
        id = 0;
175
0
    }
176
0
    else {
177
0
        id = (aVar)->Id();
178
0
        if ((1) == (id)) {
179
0
            (aActor)->FatalError("actor has been |delete|d");
180
0
        }
181
0
    }
182
0
    WriteIPDLParam(aMsg, aActor, id);
183
0
}
184
185
auto IPDLParamTraits<mozilla::dom::PServiceWorkerUpdaterChild>::Read(
186
        const IPC::Message* aMsg,
187
        PickleIterator* aIter,
188
        mozilla::ipc::IProtocol* aActor,
189
        paramType* aVar) -> bool
190
0
{
191
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PServiceWorkerUpdater", PServiceWorkerUpdaterMsgStart);
192
0
    if ((actor).isNothing()) {
193
0
        return false;
194
0
    }
195
0
196
0
    (*(aVar)) = static_cast<mozilla::dom::PServiceWorkerUpdaterChild*>((actor).value());
197
0
    return true;
198
0
}
199
200
} // namespace ipc
201
} // namespace mozilla