Coverage Report

Created: 2018-09-25 14:53

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