Coverage Report

Created: 2018-09-25 14:53

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