Coverage Report

Created: 2018-09-25 14:53

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