Coverage Report

Created: 2018-09-25 14:53

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