Coverage Report

Created: 2018-09-25 14:53

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