Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PCacheOpChild.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/cache/PCacheOpChild.h"
8
9
#include "mozilla/dom/cache/PCacheChild.h"
10
#include "mozilla/dom/cache/PCacheStorageChild.h"
11
#include "mozilla/dom/cache/PCacheStreamControlChild.h"
12
#include "mozilla/ipc/PFileDescriptorSetChild.h"
13
#include "mozilla/ipc/PChildToParentStreamChild.h"
14
#include "mozilla/ipc/PParentToChildStreamChild.h"
15
16
#include "nsIFile.h"
17
#include "GeckoProfiler.h"
18
19
namespace mozilla {
20
namespace dom {
21
namespace cache {
22
23
24
auto PCacheOpChild::Recv__delete__(
25
        const ErrorResult& aRv,
26
        const CacheOpResult& aResult) -> mozilla::ipc::IPCResult
27
0
{
28
0
    return IPC_OK();
29
0
}
30
31
auto PCacheOpChild::ActorDestroy(ActorDestroyReason aWhy) -> void
32
0
{
33
0
}
34
35
MOZ_IMPLICIT PCacheOpChild::PCacheOpChild() :
36
    mozilla::ipc::IProtocol(mozilla::ipc::ChildSide),
37
    mLivenessState(mozilla::ipc::LivenessState::Dead)
38
0
{
39
0
    MOZ_COUNT_CTOR(PCacheOpChild);
40
0
}
41
42
PCacheOpChild::~PCacheOpChild()
43
0
{
44
0
    MOZ_COUNT_DTOR(PCacheOpChild);
45
0
}
46
47
auto PCacheOpChild::RemoveManagee(
48
        int32_t aProtocolId,
49
        IProtocol* aListener) -> void
50
0
{
51
0
    FatalError("unreached");
52
0
    return;
53
0
}
54
55
auto PCacheOpChild::OnMessageReceived(const Message& msg__) -> PCacheOpChild::Result
56
0
{
57
0
    switch ((msg__).type()) {
58
0
    case PCacheOp::Msg___delete____ID:
59
0
        {
60
0
            if (mozilla::ipc::LoggingEnabledFor("PCacheOpChild")) {
61
0
                mozilla::ipc::LogMessageForProtocol("PCacheOpChild", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
62
0
            }
63
0
            AUTO_PROFILER_LABEL("PCacheOp::Msg___delete__", OTHER);
64
0
65
0
            PickleIterator iter__(msg__);
66
0
            PCacheOpChild* actor;
67
0
            ErrorResult aRv;
68
0
            CacheOpResult aResult;
69
0
70
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(actor)))))) {
71
0
                FatalError("Error deserializing 'PCacheOpChild'");
72
0
                return MsgValueError;
73
0
            }
74
0
            if ((!((*((&(actor))))))) {
75
0
                FatalError("Error deserializing 'PCacheOpChild'");
76
0
                return MsgValueError;
77
0
            }
78
0
            // Sentinel = 'actor'
79
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 875202478)))) {
80
0
                mozilla::ipc::SentinelReadError("Error deserializing 'PCacheOpChild'");
81
0
                return MsgValueError;
82
0
            }
83
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aRv)))))) {
84
0
                FatalError("Error deserializing 'ErrorResult'");
85
0
                return MsgValueError;
86
0
            }
87
0
            // Sentinel = 'aRv'
88
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 2742041894)))) {
89
0
                mozilla::ipc::SentinelReadError("Error deserializing 'ErrorResult'");
90
0
                return MsgValueError;
91
0
            }
92
0
            if ((!(ReadIPDLParam((&(msg__)), (&(iter__)), this, (&(aResult)))))) {
93
0
                FatalError("Error deserializing 'CacheOpResult'");
94
0
                return MsgValueError;
95
0
            }
96
0
            // Sentinel = 'aResult'
97
0
            if ((!(((&(msg__)))->ReadSentinel((&(iter__)), 3888726089)))) {
98
0
                mozilla::ipc::SentinelReadError("Error deserializing 'CacheOpResult'");
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__(aRv, aResult)))) {
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(PCacheOpMsgStart, 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 PCacheOpChild::OnMessageReceived(
128
        const Message& msg__,
129
        Message*& reply__) -> PCacheOpChild::Result
130
0
{
131
0
    return MsgNotKnown;
132
0
}
133
134
auto PCacheOpChild::OnCallReceived(
135
        const Message& msg__,
136
        Message*& reply__) -> PCacheOpChild::Result
137
0
{
138
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
139
0
    return MsgNotKnown;
140
0
}
141
142
auto PCacheOpChild::GetProtocolTypeId() -> int32_t
143
0
{
144
0
    return PCacheOpMsgStart;
145
0
}
146
147
auto PCacheOpChild::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 PCacheOpChild::DeallocSubtree() -> void
160
0
{
161
0
}
162
163
164
165
} // namespace cache
166
} // namespace dom
167
} // namespace mozilla
168
namespace mozilla {
169
namespace ipc {
170
auto IPDLParamTraits<mozilla::dom::cache::PCacheOpChild>::Write(
171
        IPC::Message* aMsg,
172
        mozilla::ipc::IProtocol* aActor,
173
        const paramType& aVar) -> void
174
0
{
175
0
    int32_t id;
176
0
    if ((!(aVar))) {
177
0
        id = 0;
178
0
    }
179
0
    else {
180
0
        id = (aVar)->Id();
181
0
        if ((1) == (id)) {
182
0
            (aActor)->FatalError("actor has been |delete|d");
183
0
        }
184
0
    }
185
0
    WriteIPDLParam(aMsg, aActor, id);
186
0
}
187
188
auto IPDLParamTraits<mozilla::dom::cache::PCacheOpChild>::Read(
189
        const IPC::Message* aMsg,
190
        PickleIterator* aIter,
191
        mozilla::ipc::IProtocol* aActor,
192
        paramType* aVar) -> bool
193
0
{
194
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PCacheOp", PCacheOpMsgStart);
195
0
    if ((actor).isNothing()) {
196
0
        return false;
197
0
    }
198
0
199
0
    (*(aVar)) = static_cast<mozilla::dom::cache::PCacheOpChild*>((actor).value());
200
0
    return true;
201
0
}
202
203
} // namespace ipc
204
} // namespace mozilla