Coverage Report

Created: 2018-09-25 14:53

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