Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/ipc/ipdl/PVRGPUParent.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/PVRGPUParent.h"
8
9
10
#include "nsIFile.h"
11
#include "GeckoProfiler.h"
12
13
namespace mozilla {
14
namespace gfx {
15
16
17
auto PVRGPUParent::ActorDestroy(ActorDestroyReason aWhy) -> void
18
0
{
19
0
}
20
21
auto PVRGPUParent::ProcessingError(
22
        Result aCode,
23
        const char* aReason) -> void
24
0
{
25
0
}
26
27
auto PVRGPUParent::ShouldContinueFromReplyTimeout() -> bool
28
0
{
29
0
    return true;
30
0
}
31
32
auto PVRGPUParent::EnteredCxxStack() -> void
33
0
{
34
0
}
35
36
auto PVRGPUParent::ExitedCxxStack() -> void
37
0
{
38
0
}
39
40
auto PVRGPUParent::EnteredCall() -> void
41
0
{
42
0
}
43
44
auto PVRGPUParent::ExitedCall() -> void
45
0
{
46
0
}
47
48
MOZ_IMPLICIT PVRGPUParent::PVRGPUParent() :
49
    mozilla::ipc::IToplevelProtocol("PVRGPUParent", PVRGPUMsgStart, mozilla::ipc::ParentSide),
50
    mLivenessState(mozilla::ipc::LivenessState::Start)
51
0
{
52
0
    MOZ_COUNT_CTOR(PVRGPUParent);
53
0
}
54
55
PVRGPUParent::~PVRGPUParent()
56
0
{
57
0
    MOZ_COUNT_DTOR(PVRGPUParent);
58
0
}
59
60
auto PVRGPUParent::RemoveManagee(
61
        int32_t aProtocolId,
62
        IProtocol* aListener) -> void
63
0
{
64
0
    FatalError("unreached");
65
0
    return;
66
0
}
67
68
auto PVRGPUParent::OnMessageReceived(const Message& msg__) -> PVRGPUParent::Result
69
0
{
70
0
    switch ((msg__).type()) {
71
0
    case PVRGPU::Msg_StartVRService__ID:
72
0
        {
73
0
            if (mozilla::ipc::LoggingEnabledFor("PVRGPUParent")) {
74
0
                mozilla::ipc::LogMessageForProtocol("PVRGPUParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
75
0
            }
76
0
            AUTO_PROFILER_LABEL("PVRGPU::Msg_StartVRService", OTHER);
77
0
78
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
79
0
                FatalError("Transition error");
80
0
                return MsgValueError;
81
0
            }
82
0
            if ((!(RecvStartVRService()))) {
83
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
84
0
                // Error handled in mozilla::ipc::IPCResult
85
0
                return MsgProcessingError;
86
0
            }
87
0
88
0
            return MsgProcessed;
89
0
        }
90
0
    case PVRGPU::Msg_StopVRService__ID:
91
0
        {
92
0
            if (mozilla::ipc::LoggingEnabledFor("PVRGPUParent")) {
93
0
                mozilla::ipc::LogMessageForProtocol("PVRGPUParent", OtherPid(), "Received ", ((&(msg__)))->type(), mozilla::ipc::MessageDirection::eReceiving);
94
0
            }
95
0
            AUTO_PROFILER_LABEL("PVRGPU::Msg_StopVRService", OTHER);
96
0
97
0
            if ((!(StateTransition(false, (&(mLivenessState)))))) {
98
0
                FatalError("Transition error");
99
0
                return MsgValueError;
100
0
            }
101
0
            if ((!(RecvStopVRService()))) {
102
0
                mozilla::ipc::ProtocolErrorBreakpoint("Handler returned error code!");
103
0
                // Error handled in mozilla::ipc::IPCResult
104
0
                return MsgProcessingError;
105
0
            }
106
0
107
0
            return MsgProcessed;
108
0
        }
109
0
    default:
110
0
        {
111
0
            return MsgNotKnown;
112
0
        }
113
0
    case SHMEM_CREATED_MESSAGE_TYPE:
114
0
        {
115
0
            FatalError("this protocol tree does not use shmem");
116
0
            return MsgNotKnown;
117
0
        }
118
0
    case SHMEM_DESTROYED_MESSAGE_TYPE:
119
0
        {
120
0
            FatalError("this protocol tree does not use shmem");
121
0
            return MsgNotKnown;
122
0
        }
123
0
    }
124
0
}
125
126
auto PVRGPUParent::OnMessageReceived(
127
        const Message& msg__,
128
        Message*& reply__) -> PVRGPUParent::Result
129
0
{
130
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
131
0
    return MsgNotKnown;
132
0
}
133
134
auto PVRGPUParent::OnCallReceived(
135
        const Message& msg__,
136
        Message*& reply__) -> PVRGPUParent::Result
137
0
{
138
0
    MOZ_ASSERT_UNREACHABLE("message protocol not supported");
139
0
    return MsgNotKnown;
140
0
}
141
142
auto PVRGPUParent::GetProtocolTypeId() -> int32_t
143
0
{
144
0
    return PVRGPUMsgStart;
145
0
}
146
147
auto PVRGPUParent::OnChannelClose() -> void
148
0
{
149
0
    DestroySubtree(NormalShutdown);
150
0
    DeallocSubtree();
151
0
    DeallocShmems();
152
0
    DeallocPVRGPUParent();
153
0
}
154
155
auto PVRGPUParent::OnChannelError() -> void
156
0
{
157
0
    DestroySubtree(AbnormalShutdown);
158
0
    DeallocSubtree();
159
0
    DeallocShmems();
160
0
    DeallocPVRGPUParent();
161
0
}
162
163
auto PVRGPUParent::DestroySubtree(ActorDestroyReason why) -> void
164
0
{
165
0
    // Reject owning pending responses.
166
0
    (GetIPCChannel())->RejectPendingResponsesForActor(this);
167
0
168
0
    // Finally, destroy "us".
169
0
    ActorDestroy(why);
170
0
}
171
172
auto PVRGPUParent::DeallocSubtree() -> void
173
0
{
174
0
}
175
176
auto PVRGPUParent::DeallocPVRGPUParent() -> void
177
0
{
178
0
}
179
180
181
182
} // namespace gfx
183
} // namespace mozilla
184
namespace mozilla {
185
namespace ipc {
186
auto IPDLParamTraits<mozilla::gfx::PVRGPUParent>::Write(
187
        IPC::Message* aMsg,
188
        mozilla::ipc::IProtocol* aActor,
189
        const paramType& aVar) -> void
190
0
{
191
0
    int32_t id;
192
0
    if ((!(aVar))) {
193
0
        id = 0;
194
0
    }
195
0
    else {
196
0
        id = (aVar)->Id();
197
0
        if ((1) == (id)) {
198
0
            (aActor)->FatalError("actor has been |delete|d");
199
0
        }
200
0
    }
201
0
    WriteIPDLParam(aMsg, aActor, id);
202
0
}
203
204
auto IPDLParamTraits<mozilla::gfx::PVRGPUParent>::Read(
205
        const IPC::Message* aMsg,
206
        PickleIterator* aIter,
207
        mozilla::ipc::IProtocol* aActor,
208
        paramType* aVar) -> bool
209
0
{
210
0
    mozilla::Maybe<mozilla::ipc::IProtocol*> actor = (aActor)->ReadActor(aMsg, aIter, true, "PVRGPU", PVRGPUMsgStart);
211
0
    if ((actor).isNothing()) {
212
0
        return false;
213
0
    }
214
0
215
0
    (*(aVar)) = static_cast<mozilla::gfx::PVRGPUParent*>((actor).value());
216
0
    return true;
217
0
}
218
219
} // namespace ipc
220
} // namespace mozilla