Coverage Report

Created: 2018-09-25 14:53

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